Logging: Use CLOG for blenkernel
[blender.git] / source / blender / blenkernel / intern / context.c
index cff1d1a8947e04faabf4d086496bcb9ad2120280..cba9ab3611e765d3e1f06132176c3e3588293f94 100644 (file)
 
 #include "RNA_access.h"
 
+#include "CLG_log.h"
+
 #ifdef WITH_PYTHON
 #  include "BPY_extern.h"
 #endif
 
+static CLG_LogRef LOG = {"bke.context"};
+
 /* struct */
 
 struct bContext {
@@ -255,10 +259,10 @@ static void *ctx_wm_python_context_get(
                                return result.ptr.data;
                        }
                        else {
-                               printf("PyContext '%s' is a '%s', expected a '%s'\n",
-                                      member,
-                                      RNA_struct_identifier(result.ptr.type),
-                                      RNA_struct_identifier(member_type));
+                               CLOG_WARN(&LOG, "PyContext '%s' is a '%s', expected a '%s'",
+                                         member,
+                                         RNA_struct_identifier(result.ptr.type),
+                                         RNA_struct_identifier(member_type));
                        }
                }
        }
@@ -413,8 +417,8 @@ PointerRNA CTX_data_pointer_get_type(const bContext *C, const char *member, Stru
                        return ptr;
                }
                else {
-                       printf("%s: warning, member '%s' is '%s', not '%s'\n",
-                              __func__, member, RNA_struct_identifier(ptr.type), RNA_struct_identifier(type));
+                       CLOG_WARN(&LOG, "member '%s' is '%s', not '%s'",
+                                 member, RNA_struct_identifier(ptr.type), RNA_struct_identifier(type));
                }
        }