Skip to content

Disable theming when console output is redirected #40

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

Merged
merged 2 commits into from
Jun 1, 2021

Conversation

nblumhardt
Copy link
Member

This employs the same approach that Serilog.Sinks.Console uses: if either STDOUT or STDERR is redirected, disable theming.

It would be nicer to be precise and only disable theming when writing to a redirected stream, but the interface between the console sink and expression template doesn't allow us to sniff for it (the template only sees the output as a buffering StringWriter).

Fixes #39

@nblumhardt nblumhardt merged commit f0fcfdc into serilog:dev Jun 1, 2021
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.

Disable themes when output is redirected
1 participant