Skip to content

Comments

A first pass at implementing logging scopes#57

Open
osric-ukho wants to merge 1 commit intomainfrom
feature/scopes
Open

A first pass at implementing logging scopes#57
osric-ukho wants to merge 1 commit intomainfrom
feature/scopes

Conversation

@osric-ukho
Copy link

Nothing complicated, add scopes to a list and return an IDisposable that removes the scope at dispose time.

When Log is called pull the values out of scopes and add them to the log properties.

Probably want to add support for when is a string (the tricky bit is what to put as the key so it doesn't get overwritten by the next one).

(The BeginScope(string format, params object?[] args) extension from Microsoft.Extension.Logging uses a nice looking FormatedLogValues class, but that's internal)

(I think my format rules may have got away from me)

@sonarqubecloud
Copy link

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.

1 participant