[Bf-blender-cvs] [359acad5e49] master: Cleanup: CLog fix bad use_color default

Ray Molenkamp noreply at git.blender.org
Thu Sep 10 19:27:48 CEST 2020


Commit: 359acad5e49bb23a603706c47a05b9ffc1c92d33
Author: Ray Molenkamp
Date:   Thu Sep 10 11:27:41 2020 -0600
Branches: master
https://developer.blender.org/rB359acad5e49bb23a603706c47a05b9ffc1c92d33

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

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

M	intern/clog/clog.c

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

diff --git a/intern/clog/clog.c b/intern/clog/clog.c
index 84b850f5042..17c9d49ee51 100644
--- a/intern/clog/clog.c
+++ b/intern/clog/clog.c
@@ -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);



More information about the Bf-blender-cvs mailing list