-
Notifications
You must be signed in to change notification settings - Fork 59
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
Introduce Console formatter for Microsoft.Extensions.Logging.Console" #439
Conversation
Mpdreamz
commented
Sep 16, 2024
- Introduce Console formatter Microsoft.Extensions.Logging
- Add README contents
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.
A few comments to consider, nothing blocking if we want to get this in and follow up.
There's also use of StringBuilder
. Given this is high-volume, do we want to consider refactoring to rented array/Span
based processing to improve performance?
log.Scopes ??= new List<string>(); | ||
|
||
|
||
var scopeValues = (scope as IEnumerable<KeyValuePair<string, object>>)?.ToList(); |
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 think this is fine for now, but maybe we should consider a lower allocation approach with a rented array for these or even stackalloc
for low volumes?
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 think we should but this is already in place today, only lights up in the PR because we moved it to a new shared library.
Shall we follow up with that in another PR?
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.
Yeah, let's create an issue to track it as an enhancement. I'd happily pick it up if you want to assign it to me. I love a bit of Span<T>
with the morning coffee!
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
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.
LGTM