[Bf-blender-cvs] [e856443c99d] master: CLOG: Add getter to know if output supports coloring

Clément Foucault noreply at git.blender.org
Sat Oct 24 20:07:17 CEST 2020


Commit: e856443c99d5175b3de6370590142a8d03054bb3
Author: Clément Foucault
Date:   Fri Oct 23 19:26:35 2020 +0200
Branches: master
https://developer.blender.org/rBe856443c99d5175b3de6370590142a8d03054bb3

CLOG: Add getter to know if output supports coloring

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

M	intern/clog/CLG_log.h
M	intern/clog/clog.c

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

diff --git a/intern/clog/CLG_log.h b/intern/clog/CLG_log.h
index a2841c5c8b3..3e51e228bac 100644
--- a/intern/clog/CLG_log.h
+++ b/intern/clog/CLG_log.h
@@ -150,6 +150,8 @@ void CLG_level_set(int level);
 
 void CLG_logref_init(CLG_LogRef *clg_ref);
 
+int CLG_color_support_get(CLG_LogRef *clg_ref);
+
 /** Declare outside function, declare as extern in header. */
 #define CLG_LOGREF_DECLARE_GLOBAL(var, id) \
   static CLG_LogRef _static_##var = {id}; \
diff --git a/intern/clog/clog.c b/intern/clog/clog.c
index 37c8393f532..2bc3985c71f 100644
--- a/intern/clog/clog.c
+++ b/intern/clog/clog.c
@@ -755,4 +755,12 @@ void CLG_logref_init(CLG_LogRef *clg_ref)
 #endif
 }
 
+int CLG_color_support_get(CLG_LogRef *clg_ref)
+{
+  if (clg_ref->type == NULL) {
+    CLG_logref_init(clg_ref);
+  }
+  return clg_ref->type->ctx->use_color;
+}
+
 /** \} */



More information about the Bf-blender-cvs mailing list