diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-10 10:54:27 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-10 10:54:27 +0300 |
commit | bd76c887546558488aa07a5c01d81647aa7af7e9 (patch) | |
tree | 40fffcdd40c1ba0fb74ec2ee552592d0dc759a12 /source/blender | |
parent | 16b795cb95c8006993ebfd5398eca02bae6b75ea (diff) |
Depsgraph: Flush debug prints
Makes it more reliable to see what was updating last when
crash happens.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 66ddaa6b0d5..da7ac03146e 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -531,12 +531,14 @@ void DEG_debug_print_eval(const char *function_name, if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) { return; } - printf("%s on %s %s(%p)%s\n", - function_name, - object_name, - DEG::deg_color_for_pointer(object_address).c_str(), - object_address, - DEG::deg_color_end().c_str()); + fprintf(stdout, + "%s on %s %s(%p)%s\n", + function_name, + object_name, + DEG::deg_color_for_pointer(object_address).c_str(), + object_address, + DEG::deg_color_end().c_str()); + fflush(stdout); } void DEG_debug_print_eval_subdata(const char *function_name, @@ -549,17 +551,19 @@ void DEG_debug_print_eval_subdata(const char *function_name, if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) { return; } - printf("%s on %s %s(%p)%s %s %s %s(%p)%s\n", - function_name, - object_name, - DEG::deg_color_for_pointer(object_address).c_str(), - object_address, - DEG::deg_color_end().c_str(), - subdata_comment, - subdata_name, - DEG::deg_color_for_pointer(subdata_address).c_str(), - subdata_address, - DEG::deg_color_end().c_str()); + fprintf(stdout, + "%s on %s %s(%p)%s %s %s %s(%p)%s\n", + function_name, + object_name, + DEG::deg_color_for_pointer(object_address).c_str(), + object_address, + DEG::deg_color_end().c_str(), + subdata_comment, + subdata_name, + DEG::deg_color_for_pointer(subdata_address).c_str(), + subdata_address, + DEG::deg_color_end().c_str()); + fflush(stdout); } void DEG_debug_print_eval_subdata_index(const char *function_name, @@ -573,18 +577,20 @@ void DEG_debug_print_eval_subdata_index(const char *function_name, if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) { return; } - printf("%s on %s %s(%p)^%s %s %s[%d] %s(%p)%s\n", - function_name, - object_name, - DEG::deg_color_for_pointer(object_address).c_str(), - object_address, - DEG::deg_color_end().c_str(), - subdata_comment, - subdata_name, - subdata_index, - DEG::deg_color_for_pointer(subdata_address).c_str(), - subdata_address, - DEG::deg_color_end().c_str()); + fprintf(stdout, + "%s on %s %s(%p)^%s %s %s[%d] %s(%p)%s\n", + function_name, + object_name, + DEG::deg_color_for_pointer(object_address).c_str(), + object_address, + DEG::deg_color_end().c_str(), + subdata_comment, + subdata_name, + subdata_index, + DEG::deg_color_for_pointer(subdata_address).c_str(), + subdata_address, + DEG::deg_color_end().c_str()); + fflush(stdout); } void DEG_debug_print_eval_time(const char *function_name, @@ -595,11 +601,13 @@ void DEG_debug_print_eval_time(const char *function_name, if ((G.debug & G_DEBUG_DEPSGRAPH_EVAL) == 0) { return; } - printf("%s on %s %s(%p)%s at time %f\n", - function_name, - object_name, - DEG::deg_color_for_pointer(object_address).c_str(), - object_address, - DEG::deg_color_end().c_str(), - time); + fprintf(stdout, + "%s on %s %s(%p)%s at time %f\n", + function_name, + object_name, + DEG::deg_color_for_pointer(object_address).c_str(), + object_address, + DEG::deg_color_end().c_str(), + time); + fflush(stdout); } |