diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-10-23 20:26:35 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2020-10-24 21:07:05 +0300 |
commit | e856443c99d5175b3de6370590142a8d03054bb3 (patch) | |
tree | 102ce394831601cc9ffb53fc9f4ad9d4ff91f3eb | |
parent | b37c40a575663ea42d397d57d3ef902b4d9777ec (diff) |
CLOG: Add getter to know if output supports coloring
-rw-r--r-- | intern/clog/CLG_log.h | 2 | ||||
-rw-r--r-- | intern/clog/clog.c | 8 |
2 files changed, 10 insertions, 0 deletions
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; +} + /** \} */ |