-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ConsoleTarget - Apply Encoding on InitializeTarget, if Console available #1850
Conversation
6932272
to
ee16185
Compare
ee16185
to
b87e501
Compare
Current coverage is 82% (diff: 62%)@@ master #1850 diff @@
==========================================
Files 276 276
Lines 18472 18503 +31
Methods 2857 2859 +2
Messages 0 0
Branches 2129 2137 +8
==========================================
+ Hits 15061 15096 +35
+ Misses 2922 2915 -7
- Partials 489 492 +3
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any idea if we could unit test this?
@@ -86,17 +86,23 @@ public sealed class ConsoleTarget : TargetWithLayoutHeaderAndFooter | |||
[DefaultValue(false)] | |||
public bool Error { get; set; } | |||
|
|||
#if !SILVERLIGHT && !__IOS__ && !__ANDROID__ | |||
/// <summary> | |||
/// The encoding for writing messages to the <see cref="Console"/>. | |||
/// </summary> | |||
/// <remarks>Has side effect</remarks> | |||
public Encoding Encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In SILVERLIGHT / IOS / ANDROID we have now the property Encoding
, but it doesn't work. Do you think that's an improvement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no opinion. Just removed the defines, since the property was no longer using the console directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer removing it, as it won't do anything. This could be confusing from the API.
I guess one could try and test if the set encoding actually updates the Console.OutputEncoding, but I can see you added the encoding property without any tests :) |
b6567bc
to
7a7e2c0
Compare
…s available (Test)
7a7e2c0
to
04213d8
Compare
…s available (Fix)
0f441bb
to
df648fa
Compare
Made a unit-test, and found a bug when dynamically changing ConsoleTarget.Encoding after it has been initialized. Guess I learned my lesson once again :) |
@@ -86,17 +86,23 @@ public sealed class ConsoleTarget : TargetWithLayoutHeaderAndFooter | |||
[DefaultValue(false)] | |||
public bool Error { get; set; } | |||
|
|||
#if !SILVERLIGHT && !__IOS__ && !__ANDROID__ | |||
/// <summary> | |||
/// The encoding for writing messages to the <see cref="Console"/>. | |||
/// </summary> | |||
/// <remarks>Has side effect</remarks> | |||
public Encoding Encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer removing it, as it won't do anything. This could be confusing from the API.
Looks good, only the API change is a breaker (for SILVERLIGHT /IOS /ANDROID). |
…s available (Review comments)
56d8cc3
to
1751df7
Compare
Thanks! |
Attempt to fix #1845 using detectConsoleAvailable=true
This change is