[FFmpeg-devel] [PATCH] lavu/log: Remove the use of NO_COLOR env variable

Timothy Gu timothygu99 at gmail.com
Fri Aug 30 02:58:02 CEST 2013


This was deprecated in 2010 in commit c3d07c173b2438d07056efd671a3f36361351552.
This is deprecated in fork too, although they didn't yet remove it.

Signed-off-by: Timothy Gu <timothygu99 at gmail.com>
---
 doc/avtools-common-opts.texi | 8 +++-----
 libavutil/log.c              | 8 +++-----
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/doc/avtools-common-opts.texi b/doc/avtools-common-opts.texi
index 3892a4a..ecd992f 100644
--- a/doc/avtools-common-opts.texi
+++ b/doc/avtools-common-opts.texi
@@ -155,11 +155,9 @@ Show everything, including debugging information.
 
 By default the program logs to stderr, if coloring is supported by the
 terminal, colors are used to mark errors and warnings. Log coloring
-can be disabled setting the environment variable
- at env{AV_LOG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
-the environment variable @env{AV_LOG_FORCE_COLOR}.
-The use of the environment variable @env{NO_COLOR} is deprecated and
-will be dropped in a following FFmpeg version.
+can be disabled by setting the environment variable
+ at env{AV_LOG_FORCE_NOCOLOR}, or can be forced by setting the environment
+variable @env{AV_LOG_FORCE_COLOR}.
 
 @item -report
 Dump full command line and console output to a file named
diff --git a/libavutil/log.c b/libavutil/log.c
index 53be3ea..af3226b 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -108,22 +108,20 @@ static void colored_fputs(int level, const char *str)
 #if HAVE_SETCONSOLETEXTATTRIBUTE
         CONSOLE_SCREEN_BUFFER_INFO con_info;
         con = GetStdHandle(STD_ERROR_HANDLE);
-        use_color = (con != INVALID_HANDLE_VALUE) && !getenv("NO_COLOR") &&
-                    !getenv("AV_LOG_FORCE_NOCOLOR");
+        use_color = (con != INVALID_HANDLE_VALUE) && !getenv("AV_LOG_FORCE_NOCOLOR");
         if (use_color) {
             GetConsoleScreenBufferInfo(con, &con_info);
             attr_orig  = con_info.wAttributes;
             background = attr_orig & 0xF0;
         }
 #elif HAVE_ISATTY
-        use_color = !getenv("NO_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR") &&
+        use_color = !getenv("AV_LOG_FORCE_NOCOLOR") &&
                     (getenv("TERM") && isatty(2) ||
                      getenv("AV_LOG_FORCE_COLOR"));
         if (getenv("AV_LOG_FORCE_256COLOR"))
             use_color *= 256;
 #else
-        use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("NO_COLOR") &&
-                   !getenv("AV_LOG_FORCE_NOCOLOR");
+        use_color = getenv("AV_LOG_FORCE_COLOR") && !getenv("AV_LOG_FORCE_NOCOLOR");
 #endif
     }
 
-- 
1.8.1.2



More information about the ffmpeg-devel mailing list