[Bf-blender-cvs] [ee413ed5641] soc-2020-info-editor: Remove uses G.debug guards from CLOG (simple cases)

Mateusz Grzeliński noreply at git.blender.org
Thu Jul 9 16:39:32 CEST 2020


Commit: ee413ed56415a8b0f6922046ca21265b6b44fe94
Author: Mateusz Grzeliński
Date:   Wed Jul 8 18:47:39 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rBee413ed56415a8b0f6922046ca21265b6b44fe94

Remove uses G.debug guards from CLOG (simple cases)

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

M	source/blender/blenkernel/BKE_global.h
M	source/blender/blenkernel/intern/anim_data.c
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/fcurve_driver.c
M	source/blender/blenkernel/intern/mesh_evaluate.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/interface/CMakeLists.txt
M	source/blender/editors/interface/interface_layout.c
M	source/blender/editors/screen/CMakeLists.txt
M	source/blender/editors/screen/screen_edit.c
M	source/blender/editors/undo/ed_undo.c
M	source/blender/windowmanager/intern/wm_keymap.c
M	source/blender/windowmanager/intern/wm_window.c

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

diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index d63a106011c..08b0eebbd4b 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -134,10 +134,10 @@ enum {
   G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
   G_DEBUG_FFMPEG = (1 << 1),
   G_DEBUG_PYTHON = (1 << 2),                /* extra python info */
-  G_DEBUG_EVENTS = (1 << 3),                /* input/window/screen events */
-  G_DEBUG_HANDLERS = (1 << 4),              /* events handling */
+  G_DEBUG_EVENTS = (1 << 3),                /* unused, converted to log WM_LOG_EVENTS */
+  G_DEBUG_HANDLERS = (1 << 4),              /* unused, converted to log WM_LOG_HANDLERS  */
   G_DEBUG_WM = (1 << 5),                    /* operator, undo */
-  G_DEBUG_JOBS = (1 << 6),                  /* jobs time profiling, currently unused */
+  G_DEBUG_JOBS = (1 << 6),                  /* unused, converted to log WM_LOG_JOB */
   G_DEBUG_FREESTYLE = (1 << 7),             /* freestyle messages */
   G_DEBUG_DEPSGRAPH_BUILD = (1 << 8),       /* depsgraph construction messages */
   G_DEBUG_DEPSGRAPH_EVAL = (1 << 9),        /* depsgraph evaluation messages */
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c
index 06ae45a28cd..3e8f3ea33cc 100644
--- a/source/blender/blenkernel/intern/anim_data.c
+++ b/source/blender/blenkernel/intern/anim_data.c
@@ -500,13 +500,11 @@ void action_move_fcurves_by_basepath(bAction *srcAct, bAction *dstAct, const cha
 
   /* sanity checks */
   if (ELEM(NULL, srcAct, dstAct, basepath)) {
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG,
-                 "srcAct: %p, dstAct: %p, basepath: %p has insufficient info to work with",
-                 (void *)srcAct,
-                 (void *)dstAct,
-                 (void *)basepath);
-    }
+    CLOG_ERROR(&LOG,
+               "srcAct: %p, dstAct: %p, basepath: %p has insufficient info to work with",
+               (void *)srcAct,
+               (void *)dstAct,
+               (void *)basepath);
     return;
   }
 
@@ -588,9 +586,7 @@ void BKE_animdata_separate_by_basepath(Main *bmain, ID *srcID, ID *dstID, ListBa
 
   /* sanity checks */
   if (ELEM(NULL, srcID, dstID)) {
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG, "no source or destination ID to separate AnimData with");
-    }
+    CLOG_ERROR(&LOG, "no source or destination ID to separate AnimData with");
     return;
   }
 
@@ -599,9 +595,7 @@ void BKE_animdata_separate_by_basepath(Main *bmain, ID *srcID, ID *dstID, ListBa
   dstAdt = BKE_animdata_add_id(dstID);
 
   if (ELEM(NULL, srcAdt, dstAdt)) {
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG, "no AnimData for this pair of ID's");
-    }
+    CLOG_ERROR(&LOG, "no AnimData for this pair of ID's");
     return;
   }
 
@@ -921,9 +915,7 @@ char *BKE_animsys_fix_rna_path_rename(ID *owner_id,
 
   /* if no action, no need to proceed */
   if (ELEM(NULL, owner_id, old_path)) {
-    if (G.debug & G_DEBUG) {
-      CLOG_WARN(&LOG, "early abort");
-    }
+    CLOG_WARN(&LOG, "early abort");
     return old_path;
   }
 
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 6eb5e7c7c2f..35c58d50f06 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -196,9 +196,7 @@ KS_Path *BKE_keyingset_add_path(KeyingSet *ks,
 
   /* don't add if there is already a matching KS_Path in the KeyingSet */
   if (BKE_keyingset_find_path(ks, id, group_name, rna_path, array_index, groupmode)) {
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG, "destination already exists in Keying Set");
-    }
+    CLOG_ERROR(&LOG, "destination already exists in Keying Set");
     return NULL;
   }
 
@@ -328,14 +326,12 @@ bool BKE_animsys_store_rna_setting(PointerRNA *ptr,
         int array_len = RNA_property_array_length(&r_result->ptr, r_result->prop);
 
         if (array_len && array_index >= array_len) {
-          if (G.debug & G_DEBUG) {
-            CLOG_WARN(&LOG,
-                      "Animato: Invalid array index. ID = '%s',  '%s[%d]', array length is %d",
-                      (ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
-                      path,
-                      array_index,
-                      array_len - 1);
-          }
+          CLOG_WARN(&LOG,
+                    "Animato: Invalid array index. ID = '%s',  '%s[%d]', array length is %d",
+                    (ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
+                    path,
+                    array_index,
+                    array_len - 1);
         }
         else {
           r_result->prop_index = array_len ? array_index : -1;
@@ -347,13 +343,11 @@ bool BKE_animsys_store_rna_setting(PointerRNA *ptr,
       /* failed to get path */
       /* XXX don't tag as failed yet though, as there are some legit situations (Action Constraint)
        * where some channels will not exist, but shouldn't lock up Action */
-      if (G.debug & G_DEBUG) {
-        CLOG_WARN(&LOG,
-                  "Animato: Invalid path. ID = '%s',  '%s[%d]'",
-                  (ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
-                  path,
-                  array_index);
-      }
+      CLOG_WARN(&LOG,
+                "Animato: Invalid path. ID = '%s',  '%s[%d]'",
+                (ptr->owner_id) ? (ptr->owner_id->name + 2) : "<No ID>",
+                path,
+                array_index);
     }
   }
 
diff --git a/source/blender/blenkernel/intern/fcurve_driver.c b/source/blender/blenkernel/intern/fcurve_driver.c
index a0625918a62..ee00245f478 100644
--- a/source/blender/blenkernel/intern/fcurve_driver.c
+++ b/source/blender/blenkernel/intern/fcurve_driver.c
@@ -115,9 +115,7 @@ static float dtar_get_prop_val(ChannelDriver *driver, DriverTarget *dtar)
 
   /* error check for missing pointer... */
   if (id == NULL) {
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG, "driver has an invalid target to use (path = %s)", dtar->rna_path);
-    }
+    CLOG_ERROR(&LOG, "driver has an invalid target to use (path = %s)", dtar->rna_path);
 
     driver->flag |= DRIVER_FLAG_INVALID;
     dtar->flag |= DTAR_FLAG_INVALID;
@@ -130,12 +128,10 @@ static float dtar_get_prop_val(ChannelDriver *driver, DriverTarget *dtar)
   /* get property to read from, and get value as appropriate */
   if (!RNA_path_resolve_property_full(&id_ptr, dtar->rna_path, &ptr, &prop, &index)) {
     /* path couldn't be resolved */
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG,
-                 "Driver Evaluation Error: cannot resolve target for %s -> %s",
-                 id->name,
-                 dtar->rna_path);
-    }
+    CLOG_ERROR(&LOG,
+               "Driver Evaluation Error: cannot resolve target for %s -> %s",
+               id->name,
+               dtar->rna_path);
 
     driver->flag |= DRIVER_FLAG_INVALID;
     dtar->flag |= DTAR_FLAG_INVALID;
@@ -146,13 +142,11 @@ static float dtar_get_prop_val(ChannelDriver *driver, DriverTarget *dtar)
     /* array */
     if (index < 0 || index >= RNA_property_array_length(&ptr, prop)) {
       /* out of bounds */
-      if (G.debug & G_DEBUG) {
-        CLOG_ERROR(&LOG,
-                   "Driver Evaluation Error: array index is out of bounds for %s -> %s (%d)",
-                   id->name,
-                   dtar->rna_path,
-                   index);
-      }
+      CLOG_ERROR(&LOG,
+                 "Driver Evaluation Error: array index is out of bounds for %s -> %s (%d)",
+                 id->name,
+                 dtar->rna_path,
+                 index);
 
       driver->flag |= DRIVER_FLAG_INVALID;
       dtar->flag |= DTAR_FLAG_INVALID;
@@ -222,9 +216,7 @@ bool driver_get_variable_property(ChannelDriver *driver,
 
   /* error check for missing pointer... */
   if (id == NULL) {
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG, "driver has an invalid target to use (path = %s)", dtar->rna_path);
-    }
+    CLOG_ERROR(&LOG, "driver has an invalid target to use (path = %s)", dtar->rna_path);
 
     driver->flag |= DRIVER_FLAG_INVALID;
     dtar->flag |= DTAR_FLAG_INVALID;
@@ -244,12 +236,10 @@ bool driver_get_variable_property(ChannelDriver *driver,
   }
   else {
     /* path couldn't be resolved */
-    if (G.debug & G_DEBUG) {
-      CLOG_ERROR(&LOG,
-                 "Driver Evaluation Error: cannot resolve target for %s -> %s",
-                 id->name,
-                 dtar->rna_path);
-    }
+    CLOG_ERROR(&LOG,
+               "Driver Evaluation Error: cannot resolve target for %s -> %s",
+               id->name,
+               dtar->rna_path);
 
     ptr = PointerRNA_NULL;
     *r_prop = NULL;
@@ -309,13 +299,11 @@ static float dvar_eval_rotDiff(ChannelDriver *driver, DriverVar *dvar)
 
   /* make sure we have enough valid targets to use - all or nothing for now... */
   if (driver_check_valid_targets(driver, dvar) != 2) {
-    if (G.debug & G_DEBUG) {
-      CLOG_WARN(&LOG,
-                "RotDiff DVar: not enough valid targets (n = %d) (a = %p, b = %p)",
-                valid_targets,
-                dvar->targets[0].id,
-                dvar->targets[1].id);
-    }
+    CLOG_WARN(&LOG,
+              "RotDiff DVar: not enough valid targets (n = %d) (a = %p, b = %p)",
+              valid_targets,
+              dvar->targets[0].id,
+              dvar->targets[1].id);
     return 0.0f;
   }
 
@@ -369,13 +357,11 @@ static float dvar_eval_locDiff(ChannelDriver *driver, DriverVar *dvar)
 
   /* make sure we have enough valid targets to use - all or nothing for now... */
   if (valid_targets < dvar->num_targets) {
-    if (G.debug & G_DEBUG) {
-      CLOG_WARN(&LOG,
-                "LocDiff DVar: not enough valid targets (n = %d) (a = %p, b = %p)",
-                valid_targets,
-                dvar->targets[0].id,
-                dvar->targets[1].id);
-    }
+    CLOG_WARN(&LOG,
+              "LocDiff DVar: not enough valid targets (n = %d) (a = %p, b = %p)",
+              valid_targets,
+              dvar->targets[0].id,
+              dvar->targets[1].id);
     return 0.0f;
   }
 
diff 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list