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

Spell check and cleanup #55

Merged
merged 7 commits into from
Mar 14, 2019
Merged

Spell check and cleanup #55

merged 7 commits into from
Mar 14, 2019

Conversation

sungam3r
Copy link
Contributor

What issue does this PR address?

Just spell check and cleanup

Does this PR introduce a breaking change?

No

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.

Great, thanks! Couple of minor comments 👍

(You can tell I originally wrote those doc comments on a long-haul flight 😆 )

@@ -37,8 +37,7 @@ public EventPropertyTokenRenderer(ConsoleTheme theme, PropertyToken token, IForm
public override void Render(LogEvent logEvent, TextWriter output)
{
// If a property is missing, don't render anything (message templates render the raw token here).
LogEventPropertyValue propertyValue;
if (!logEvent.Properties.TryGetValue(_token.PropertyName, out propertyValue))
if (!logEvent.Properties.TryGetValue(_token.PropertyName, out LogEventPropertyValue propertyValue))
Copy link
Member

Choose a reason for hiding this comment

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

var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will not compile

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake, it fits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -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))
Copy link
Member

Choose a reason for hiding this comment

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

var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}

/// <inheritdoc/>
public IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> Styles => _styles;
public IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> Styles { get; private set; }
Copy link
Member

Choose a reason for hiding this comment

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

👍 - if assignment only happens in the constructor, this doesn't need private set - { get; } alone will do the job.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@nblumhardt nblumhardt merged commit 95d1184 into serilog:dev Mar 14, 2019
@nblumhardt
Copy link
Member

Thanks, looking good 👍

(I personally consider "" to be a nice terse shorthand for string.Empty, but happy enough either way 😄.)

@sungam3r
Copy link
Contributor Author

I agree. Some StyleCop analyzer rules are controversial. String.Empty is just an obvious expression of intent.

@sungam3r sungam3r deleted the code-cleanup branch March 14, 2019 06:57
@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