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

[enhancement]: allow disabling colored log messages #89

Closed
1 task done
john-gold opened this issue Sep 16, 2023 · 7 comments
Closed
1 task done

[enhancement]: allow disabling colored log messages #89

john-gold opened this issue Sep 16, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@john-gold
Copy link

Which feature or improvement would you like to request?

I'd like to disable colored log messages.

Is your feature request related to a problem?

Currently, colored messages are always active for either logging to stdout and file.

ESC[2m2023-09-16T06:41:35.555227ZESC[0m ESC[32m INFOESC[0m ESC[2mutilsESC[0mESC[2m:ESC[0m Starting Stalwart Mail Server v0.3.7...

Code of Conduct

  • I agree to follow this project's Code of Conduct
@john-gold john-gold added the enhancement New feature or request label Sep 16, 2023
@Andy-2639
Copy link

Relates to #41

@DuncanvR
Copy link

Logging seems to be done through the tracing crate, which has support for the NO_COLOR env var. I haven't tested this, but simply exporting that might just work already -- and if it doesn't, I guess the request would be to add support for it.

@mdecimus
Copy link
Member

This feature has now been added and will be available on the next 0.3.x release. You'll be able to disable ansi as follows:

[global.tracing]
ansi = false

@mdecimus
Copy link
Member

mdecimus commented Oct 8, 2023

The option to disable ANSI colors is now available on v0.3.9.

@mdecimus mdecimus closed this as completed Oct 8, 2023
@williamdes
Copy link
Contributor

Thank you @DuncanvR for the hint
And @mdecimus for releasing the changes

@Andy-2639
Copy link

I'm using logging to stdout and a Windows Service Wrapper to redirect stdout/err to files.
Neither envvar NO_COLOR=1 nor setting

[global.tracing]
ansi = false

disables the ANSI escape sequences in the log.

Please also support disabling colors with stdout.

@mdecimus
Copy link
Member

@Andy-2639 this has been implemented now and will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants