From cd474b913b3fa1f55c1df17520a652950a38c03d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 5 Apr 2018 13:41:52 +0200 Subject: ED_undo: use logging --- source/blender/editors/undo/ed_undo.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to '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; -- cgit v1.2.3