Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Expand log level extension #790

Merged
merged 2 commits into from
Apr 16, 2018
Merged

Expand log level extension #790

merged 2 commits into from
Apr 16, 2018

Conversation

ChrisSimmons
Copy link
Contributor

@ChrisSimmons ChrisSimmons commented Mar 26, 2018

This PR expands on #629. Changes:

@dnfclas
Copy link

dnfclas commented Mar 26, 2018

CLA assistant check
All CLA requirements met.

@Eilon
Copy link
Contributor

Eilon commented Apr 9, 2018

@muratg - do we want to have someone take a look at this?

@muratg muratg requested a review from pakrym April 9, 2018 21:32
@muratg
Copy link

muratg commented Apr 9, 2018

@ChrisSimmons thanks for the PR!

@pakrym could you review when you have some time?

@pakrym pakrym self-assigned this Apr 9, 2018
@@ -38,10 +38,15 @@ public void MessageOnly_LogsCorrectValues()
logger.LogError(_state);
logger.LogCritical(_state);
logger.LogDebug(_state);
logger.Log(LogLevel.Trace, _state);
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a separate test method that calls new overloads (with exception and non zero event id)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay. I'll get to this now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added separate tests for the new overloads, one for each of the 10 "flavors" of the equivalent logger.LogLEVELNAME() extensions. Each uses a LogLevel_ prefix to the test method name (Example). Let me know if that naming works.

(FYI, I rebased and squashed commits, @pakrym.)

@pakrym
Copy link
Contributor

pakrym commented Apr 10, 2018

Please add tests for new overloads, otherwise LGTM.

Copy link
Contributor

@pakrym pakrym left a comment

Choose a reason for hiding this comment

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

^

Wire existing Log() extension with log level to use new method.
Wire up level-specific extensions to use new method
Rely on null argument check in new method
Add overloads without EventId and exception, patterns that were already present in the level-specific methods.
Hook level-specific into these new overloads.
Adds to aspnet/Logging#629 and #649
@ChrisSimmons
Copy link
Contributor Author

Also, is there any value to using a [Theory] to simplify these tests? See this, for example.

@pakrym
Copy link
Contributor

pakrym commented Apr 14, 2018

Totally, bring the Theories in.

@ChrisSimmons
Copy link
Contributor Author

OK, all set. Let me know if you have any more requested changes.

@pakrym pakrym merged commit 3821274 into aspnet:dev Apr 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants