Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose termcolor's ColorChoice and make colors optional #72

Merged
merged 2 commits into from Mar 27, 2021

Commits on Mar 26, 2021

  1. 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.
    mrkline committed Mar 26, 2021
    Copy the full SHA
    d87ea5c View commit details
    Browse the repository at this point in the history
  2. 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.
    mrkline committed Mar 26, 2021
    Copy the full SHA
    a17ca28 View commit details
    Browse the repository at this point in the history