-
Notifications
You must be signed in to change notification settings - Fork 72
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
Spell check and cleanup #55
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,8 +66,7 @@ int RenderTextToken(TextToken tt, TextWriter output) | |
|
||
int RenderPropertyToken(PropertyToken pt, IReadOnlyDictionary<string, LogEventPropertyValue> properties, TextWriter output) | ||
{ | ||
LogEventPropertyValue propertyValue; | ||
if (!properties.TryGetValue(pt.PropertyName, out propertyValue)) | ||
if (!properties.TryGetValue(pt.PropertyName, out LogEventPropertyValue propertyValue)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
{ | ||
var count = 0; | ||
using (_theme.Apply(output, ConsoleThemeStyle.Invalid, ref count)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ public class SystemConsoleTheme : ConsoleTheme | |
public static SystemConsoleTheme Grayscale { get; } = SystemConsoleThemes.Grayscale; | ||
|
||
/// <summary> | ||
/// A theme in the syle of the original <i>Serilog.Sinks.Literate</i>. | ||
/// A theme in the style of the original <i>Serilog.Sinks.Literate</i>. | ||
/// </summary> | ||
public static SystemConsoleTheme Literate { get; } = SystemConsoleThemes.Literate; | ||
|
||
|
@@ -40,20 +40,18 @@ public class SystemConsoleTheme : ConsoleTheme | |
/// </summary> | ||
public static SystemConsoleTheme Colored { get; } = SystemConsoleThemes.Colored; | ||
|
||
readonly IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> _styles; | ||
|
||
/// <summary> | ||
/// Construct a theme given a set of styles. | ||
/// </summary> | ||
/// <param name="styles">Styles to apply within the theme.</param> | ||
public SystemConsoleTheme(IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> styles) | ||
{ | ||
if (styles == null) throw new ArgumentNullException(nameof(styles)); | ||
_styles = styles.ToDictionary(kv => kv.Key, kv => kv.Value); | ||
Styles = styles.ToDictionary(kv => kv.Key, kv => kv.Value); | ||
} | ||
|
||
/// <inheritdoc/> | ||
public IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> Styles => _styles; | ||
public IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> Styles { get; private set; } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 - if assignment only happens in the constructor, this doesn't need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
|
||
/// <inheritdoc/> | ||
public override bool CanBuffer => false; | ||
|
@@ -64,7 +62,7 @@ public SystemConsoleTheme(IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleTh | |
/// <inheritdoc/> | ||
public override int Set(TextWriter output, ConsoleThemeStyle style) | ||
{ | ||
if (_styles.TryGetValue(style, out var wcts)) | ||
if (Styles.TryGetValue(style, out var wcts)) | ||
{ | ||
if (wcts.Foreground.HasValue) | ||
Console.ForegroundColor = wcts.Foreground.Value; | ||
|
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.
var
?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.
Will not compile
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.
My mistake, it fits.
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.
fixed