[Bf-blender-cvs] [8442d6ca8a0] blender-v2.91-release: CLOG: Add getter to know if output supports coloring
Clément Foucault
noreply at git.blender.org
Fri Oct 23 19:35:04 CEST 2020
Commit: 8442d6ca8a01b3f20f907bd298d9460bf57aa45b
Author: Clément Foucault
Date: Fri Oct 23 19:26:35 2020 +0200
Branches: blender-v2.91-release
https://developer.blender.org/rB8442d6ca8a01b3f20f907bd298d9460bf57aa45b
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