Depsgraph: Support colored addresses in debug prints

Enabled with --debug-depsgraph-pretty, only works with ANSI terminals.

Thanks Bastien for review!
This commit is contained in:
Sergey Sharybin
2018-03-16 12:24:08 +01:00
parent 295d8510af
commit da4efaeb87
5 changed files with 75 additions and 13 deletions

View File

@@ -761,6 +761,8 @@ static const char arg_handle_debug_mode_generic_set_doc_depsgraph_eval[] =
"\n\tEnable debug messages from dependency graph related on evaluation.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_no_threads[] =
"\n\tSwitch dependency graph to a single threaded evaluation.";
static const char arg_handle_debug_mode_generic_set_doc_depsgraph_pretty[] =
"\n\tEnable colors for dependency graph debug messages.";
static const char arg_handle_debug_mode_generic_set_doc_gpumem[] =
"\n\tEnable GPU memory stats in status bar.";
@@ -1878,6 +1880,8 @@ void main_args_setup(bContext *C, bArgs *ba, SYS_SystemHandle *syshandle)
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_time), (void *)G_DEBUG_DEPSGRAPH_TIME);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-no-threads",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_no_threads), (void *)G_DEBUG_DEPSGRAPH_NO_THREADS);
BLI_argsAdd(ba, 1, NULL, "--debug-depsgraph-pretty",
CB_EX(arg_handle_debug_mode_generic_set, depsgraph_pretty), (void *)G_DEBUG_DEPSGRAPH_PRETTY);
BLI_argsAdd(ba, 1, NULL, "--debug-gpumem",
CB_EX(arg_handle_debug_mode_generic_set, gpumem), (void *)G_DEBUG_GPU_MEM);