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

Allows disabling ANSI colours w/ env var #172

Closed
wants to merge 1 commit into from

Conversation

ccfontes
Copy link
Contributor

When reading timbre logs from files, stack traces include non-printable characters for the ANSI colour characters. This can become annoying after reading logs for a while.

While it is possible to disable ANSI colours in stack traces using (merge-config! {:output-fn (partial default-output-fn {:stacktrace-fonts {}})}), including this in every app entry point is not ideal for people like me who believe colours in stack traces should be disabled by default. No colours in logs by default could be ideal for production systems, i.e..

The changes here disable stack trace fonts when the environment variable TIMBRE_NO_STACKTRACE_FONTS is set. This doesn't break the previous behaviour of the library.

@ptaoussanis
Copy link
Member

ptaoussanis commented Jun 16, 2016

Hi Carlos, I'm on board for that - thanks!

including this in every app entry point

Not sure I understand this particular point btw. What do you mean by every app entry point?

ptaoussanis added a commit that referenced this pull request Jun 16, 2016
@ccfontes
Copy link
Contributor Author

Great! Thanks for using this change in 3b07f12.

Not sure I understand this particular point though. What do you mean by every app entry point?

In the most obvious use case, I have a leiningen project including several aws lambda function modules. I would have to include merge-config! {:output-fn (partial default-output-fn {:stacktrace-fonts {}})}) in every lambda module to disable the colours. I'm also working with a reasonable number of services where there is only one module per leiningen project where I would need to disable the logs, but that would still not be ideal, because I could use CloudFormation once to set the same environment variable in several places, which is less work I think.

ptaoussanis added a commit that referenced this pull request Jun 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants