Disable color for a logger (or Formatter) #748
Answered
by
darkfrog26
jackkoenig
asked this question in
Q&A
-
|
Is there a way to disable color for a logger other than by creating a fully custom Formatter? I quite like the default Formatter but I would like to disable color when logging to a file. In fact, even using the simple formatter with a file writer is still inserting ANSI reset at the end of every line, can I disable this? |
Beta Was this translation helpful? Give feedback.
Answered by
darkfrog26
Oct 1, 2025
Replies: 2 comments 2 replies
-
|
Sure, set the logger.withHandler(outputFormat = ASCIIOutputFormat) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jackkoenig
-
|
If you want to just permanently disable ANSI you can do: OutputFormat.default = ASCIIOutputFormat |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure, set the
outputFormatwhen creating the handler: