Skip to content

Adding support for scopes#85

Open
spasarto wants to merge 12 commits intoSumoLogic:masterfrom
spasarto:master
Open

Adding support for scopes#85
spasarto wants to merge 12 commits intoSumoLogic:masterfrom
spasarto:master

Conversation

@spasarto
Copy link
Copy Markdown

Adding support for externally stored scopes & category.

Implementation based on existing BatchingLogger: https://github.com/aspnet/Extensions/blob/master/src/Logging/Logging.AzureAppServices/src/BatchingLogger.cs

Comment thread SumoLogic.Logging.AspNetCore/LoggerOptions.cs
Comment thread SumoLogic.Logging.AspNetCore/LoggerProvider.cs Outdated
}


builder.AppendLine(message.Trim());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are we changing the default logic from

String line = string.Concat(
                message.TrimEnd(Environment.NewLine.ToCharArray()),
                Environment.NewLine);

to just
message.Trim()?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'm trying to remember my exact reason - it's been a while :)

The changes were based off of the ConsoleLogger implementation of scopes:
https://github.com/aspnet/Extensions/blob/master/src/Logging/Logging.Console/src/ConsoleLogger.cs

Specifically, they replace all new lines in message, not just the beginning and end. I know I encountered a need for this during testing, but I can't remember the case anymore.

What are your concerns in regards to trimming the start?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am unsure on why the initial code was written like that. There might have been a reason too! :) So I am just worried about touching something which we are not completely aware of. And if we can't justify this change right now, I'll prefer to revert this change. We can obviously add this change later on in some other PR, if needed.

Comment thread SumoLogic.Logging.AspNetCore/SumoLogic.Logging.AspNetCore.netstandard.csproj Outdated
Comment thread SumoLogic.Logging.AspNetCore/LoggerProvider.cs Outdated
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.

3 participants