mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Introduce FFMPEG_FORCE_NOCOLOR, with the same meaning and use of
NO_COLOR (but properly prefixed for avoiding namespace conflicts). Originally committed as revision 25899 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
efd63823e6
commit
3011ecdeb7
@ -84,7 +84,8 @@ Set the logging level used by the library.
|
|||||||
|
|
||||||
By default the program logs to stderr, if coloring is supported by the
|
By default the program logs to stderr, if coloring is supported by the
|
||||||
terminal, colors are used to mark errors and warnings. Log coloring
|
terminal, colors are used to mark errors and warnings. Log coloring
|
||||||
can be disabled setting the environment variable @env{NO_COLOR}, or can
|
can be disabled setting the environment variable
|
||||||
be forced setting the environment variable @env{FFMPEG_FORCE_COLOR}.
|
@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting
|
||||||
|
the environment variable @env{FFMPEG_FORCE_COLOR}.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
@ -62,9 +62,10 @@ static void colored_fputs(int level, const char *str){
|
|||||||
background = attr_orig & 0xF0;
|
background = attr_orig & 0xF0;
|
||||||
}
|
}
|
||||||
#elif HAVE_ISATTY
|
#elif HAVE_ISATTY
|
||||||
use_color= !getenv("NO_COLOR") && (getenv("TERM") && isatty(2) || getenv("FFMPEG_FORCE_COLOR"));
|
use_color= !getenv("NO_COLOR") && !getenv("FFMPEG_FORCE_NOCOLOR") &&
|
||||||
|
(getenv("TERM") && isatty(2) || getenv("FFMPEG_FORCE_COLOR"));
|
||||||
#else
|
#else
|
||||||
use_color= getenv("FFMPEG_FORCE_COLOR") && !getenv("NO_COLOR");
|
use_color= getenv("FFMPEG_FORCE_COLOR") && !getenv("NO_COLOR") && !getenv("FFMPEG_FORCE_NOCOLOR");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user