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).
This employs the same approach that Serilog.Sinks.Console uses: if either
STDOUT
orSTDERR
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