CLOG: Add getter to know if output supports coloring
This commit is contained in:

committed by
Howard Trickey

parent
b37c40a575
commit
e856443c99
@@ -150,6 +150,8 @@ void CLG_level_set(int level);
|
|||||||
|
|
||||||
void CLG_logref_init(CLG_LogRef *clg_ref);
|
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. */
|
/** Declare outside function, declare as extern in header. */
|
||||||
#define CLG_LOGREF_DECLARE_GLOBAL(var, id) \
|
#define CLG_LOGREF_DECLARE_GLOBAL(var, id) \
|
||||||
static CLG_LogRef _static_##var = {id}; \
|
static CLG_LogRef _static_##var = {id}; \
|
||||||
|
@@ -755,4 +755,12 @@ void CLG_logref_init(CLG_LogRef *clg_ref)
|
|||||||
#endif
|
#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;
|
||||||
|
}
|
||||||
|
|
||||||
/** \} */
|
/** \} */
|
||||||
|
Reference in New Issue
Block a user