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

Add apply theme on output redirection option #77

Merged
merged 7 commits into from
Nov 22, 2019
Merged

Add apply theme on output redirection option #77

merged 7 commits into from
Nov 22, 2019

Conversation

tjaart
Copy link

@tjaart tjaart commented Nov 21, 2019

What issue does this PR address?
color themes not appearing in output #64
#64

Does this PR introduce a breaking change?
An option is added to the Console() extension method but should not be a breaking change as it is added at the back with a default value of false, meaning it will have no effect unless explicitly activated.

Please check if the PR fulfills these requirements

  • The commit follows our guidelines
  • Unit Tests for the changes have been added (for bug fixes / features)

Other information:
Debugging the unit tests breaks for some reason. Console.IsOutputRedirected is always false when debugging on my machine with Rider. However Running the tests normally works.

@tjaart tjaart marked this pull request as ready for review November 21, 2019 11:52
Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on 👍

Adding a parameter to a method is a breaking change in C#, even if its given a default value, since the value is substituted in at the call site at compile time; code built against the earlier version will try to bind based on the old method signature and fail.

In other sinks, particularly File() since it's sometimes used as an implementation detail of other components, we've worked around this using an overloading scheme, but for console I think we're okay just making the change and bumping the major version (which is in Serilog.Sinks.Console.csproj).

Came up with another possible parameter name based on your suggested direction (which is great), let me know what you think :-)

@nblumhardt nblumhardt merged commit e5d1247 into serilog:dev Nov 22, 2019
@tjaart tjaart deleted the add_apply_theme_on_output_redirection_option branch November 25, 2019 07:21
@nblumhardt nblumhardt mentioned this pull request Jul 12, 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.

2 participants