[Bf-blender-cvs] [cd474b913b3] master: ED_undo: use logging
Campbell Barton
noreply at git.blender.org
Thu Apr 5 13:42:51 CEST 2018
Commit: cd474b913b3fa1f55c1df17520a652950a38c03d
Author: Campbell Barton
Date: Thu Apr 5 13:41:52 2018 +0200
Branches: master
https://developer.blender.org/rBcd474b913b3fa1f55c1df17520a652950a38c03d
ED_undo: use logging
===================================================================
M source/blender/editors/undo/ed_undo.c
===================================================================
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 4f62e38dc0b..09abc1f3878 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -33,6 +33,8 @@
#include "MEM_guardedalloc.h"
+#include "CLG_log.h"
+
#include "DNA_scene_types.h"
#include "BLI_utildefines.h"
@@ -60,6 +62,9 @@
#include "UI_interface.h"
#include "UI_resources.h"
+/** We only need this locally. */
+static CLG_LogRef LOG = {"ed.undo"};
+
/* -------------------------------------------------------------------- */
/** \name Generic Undo System Access
*
@@ -68,9 +73,8 @@
void ED_undo_push(bContext *C, const char *str)
{
- if (G.debug & G_DEBUG) {
- printf("%s: %s\n", __func__, str);
- }
+ CLOG_INFO(&LOG, 1, "name='%s'", str);
+
const int steps = U.undosteps;
if (steps <= 0) {
@@ -97,6 +101,7 @@ void ED_undo_push(bContext *C, const char *str)
/* note: also check undo_history_exec() in bottom if you change notifiers */
static int ed_undo_step(bContext *C, int step, const char *undoname)
{
+ CLOG_INFO(&LOG, 1, "name='%s', step=%d", undoname, step);
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win = CTX_wm_window(C);
// Main *bmain = CTX_data_main(C);
@@ -307,6 +312,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
int ret = 0;
if (op) {
+ CLOG_INFO(&LOG, 1, "idname='%s'", op->type->idname);
wmWindowManager *wm = CTX_wm_manager(C);
struct Scene *scene = CTX_data_scene(C);
@@ -367,9 +373,7 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op)
CTX_wm_region_set(C, ar);
}
else {
- if (G.debug & G_DEBUG) {
- printf("redo_cb: ED_undo_operator_repeat called with NULL 'op'\n");
- }
+ CLOG_WARN(&LOG, "called with NULL 'op'");
}
return ret;
More information about the Bf-blender-cvs
mailing list