Cleanup: CLog fix bad use_color default

`use_color` was defaulted to 'on' and only turned off when it was
decided the terminal didn't support this. This was the wrong
way to go about things, since that test only ran for Linux/Mac other
operating systems would get color formatting regardless if they
supported it.

The new default is `off` until the platform specific code inside
`CLG_ctx_output_set` turns it on after running some sanity checks.

This fix was part of the review of D8848 but deserved its on commit

Reviewed By: campbellbarton
This commit is contained in:
Ray molenkamp 2020-09-10 11:27:41 -06:00
parent 4c3ad047e7
commit 359acad5e4
1 changed files with 1 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/*
/*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
@ -235,9 +235,6 @@ static void clg_color_table_init(bool use_color)
clg_color_table[i] = "";
}
if (use_color) {
#ifdef _WIN32
/* TODO */
#else
clg_color_table[COLOR_DEFAULT] = "\033[1;37m";
clg_color_table[COLOR_RED] = "\033[1;31m";
clg_color_table[COLOR_GREEN] = "\033[1;32m";
@ -626,7 +623,6 @@ static CLogContext *CLG_ctx_init(void)
#ifdef WITH_CLOG_PTHREADS
pthread_mutex_init(&ctx->types_lock, NULL);
#endif
ctx->use_color = true;
ctx->default_type.level = 1;
CLG_ctx_output_set(ctx, stdout);