Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
7 changed files
with
49 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters