Command line interfaces that write colored output usually give users
an option to turn it off, or make it automatically shut off when writing
to a file, pipe, or unsupported terminal. termcolor already has some
nice machinery to handle this sort of thing with ColorChoice, so expose
it when creating a TermLogger.
Programmers (such as myself) who use simplelog and want to give users
this choice only have ugly alternatives. For example, you could fall
back to a WriteLogger if the user doesn't want color, but then you:
Lose out on the "mixed" logging mode you get from TerminalMode::Mixed
Have to reimplement nice ColorChoice::Auto behavior yourself,
on top of termcolor.
TermLogger/ConfigBuilder: Make colors optional
White isn't a good default for those with light terminal screens
(brighter background, darker text). This is already trivial in
termcolor, so just allow level colors to be None.
Coverage increased (+0.7%) to 67.888% when pulling a17ca28ffad2e61cadfff27f85245509f99cfe95 on mrkline:optional-color into 8338b80979bcae391a8c5bc61f13e174bc118cb2 on Drakulix:master.
TermLogger: Expose termcolor::ColorChoice
Command line interfaces that write colored output usually give users an option to turn it off, or make it automatically shut off when writing to a file, pipe, or unsupported terminal. termcolor already has some nice machinery to handle this sort of thing with ColorChoice, so expose it when creating a TermLogger.
Programmers (such as myself) who use simplelog and want to give users this choice only have ugly alternatives. For example, you could fall back to a WriteLogger if the user doesn't want color, but then you:
Lose out on the "mixed" logging mode you get from TerminalMode::Mixed
Have to reimplement nice ColorChoice::Auto behavior yourself, on top of termcolor.
TermLogger/ConfigBuilder: Make colors optional
White isn't a good default for those with light terminal screens (brighter background, darker text). This is already trivial in termcolor, so just allow level colors to be None.