[Bf-blender-cvs] [8e42106d901] soc-2020-info-editor: Convert print to CLOGs

Mateusz Grzeliński noreply at git.blender.org
Wed Jul 1 23:44:13 CEST 2020


Commit: 8e42106d901cf34f4bb73153d06dd6ea913c35a7
Author: Mateusz Grzeliński
Date:   Wed Jul 1 22:56:27 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rB8e42106d901cf34f4bb73153d06dd6ea913c35a7

Convert print to CLOGs

===================================================================

M	source/blender/blenkernel/BKE_armature.h
M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/armature_update.c
M	source/blender/blenkernel/intern/report.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 6fb6675a05a..592c46e4271 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -28,6 +28,8 @@
 extern "C" {
 #endif
 
+extern struct CLG_LogRef *BKE_LOG_ARMATURE;
+
 struct BMEditMesh;
 struct Bone;
 struct Depsgraph;
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index 007062abb5b..316e5fcb8f8 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -64,7 +64,7 @@
 
 #include "CLG_log.h"
 
-static CLG_LogRef LOG = {"bke.armature"};
+CLG_LOGREF_DECLARE_GLOBAL(BKE_LOG_ARMATURE, "bke.armature");
 
 /* -------------------------------------------------------------------- */
 /** \name Prototypes
@@ -2155,7 +2155,7 @@ static void pose_proxy_sync(Object *ob, Object *from, int layer_protected)
   for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) {
     if (pchan->bone->layer & layer_protected) {
       if (BKE_pose_channel_find_name(frompose, pchan->name) == NULL) {
-        CLOG_ERROR(&LOG,
+        CLOG_ERROR(BKE_LOG_ARMATURE,
                    "failed to sync proxy armature because '%s' is missing pose channel '%s'",
                    from->id.name,
                    pchan->name);
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index d0a5e4348b9..135786479a9 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -24,6 +24,7 @@
  */
 
 #include "MEM_guardedalloc.h"
+#include <CLG_log.h>
 
 #include "BLI_listbase.h"
 #include "BLI_math.h"
@@ -919,10 +920,10 @@ void BKE_pose_eval_proxy_copy_bone(struct Depsgraph *depsgraph, Object *object,
   bPoseChannel *pchan_from = BKE_pose_channel_find_name(object->proxy_from->pose, pchan->name);
 #endif
   if (pchan_from == NULL) {
-    printf(
-        "WARNING: Could not find bone %s in linked ID anymore... "
-        "You should delete and re-generate your proxy.\n",
-        pchan->name);
+    CLOG_WARN(BKE_LOG_ARMATURE,
+              "Could not find bone %s in linked ID anymore... "
+              "You should delete and re-generate your proxy",
+              pchan->name);
     return;
   }
   BKE_pose_copy_pchan_result(pchan, pchan_from);
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index 2a9a401a4cf..5ac34e43b49 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -382,10 +382,10 @@ bool BKE_report_write_file(const char *filepath, ReportList *reports, const char
   errno = 0;
   fp = BLI_fopen(filepath, "wb");
   if (fp == NULL) {
-    fprintf(stderr,
-            "Unable to save '%s': %s\n",
-            filepath,
-            errno ? strerror(errno) : "Unknown error opening file");
+    CLOG_ERROR(&LOG,
+               "Unable to save '%s': %s",
+               filepath,
+               errno ? strerror(errno) : "Unknown error opening file");
     return false;
   }



More information about the Bf-blender-cvs mailing list