Merged
Conversation
This ensures that valid loggers can be acquired before the LogManager is initialized. These loggers will function after initialization.
This lets users define an extension method on their objects that returns an append operation. This is a way to support unknown objects in interpolated strings.
Use the pinned object heap instead of native allocations.
This lets control the message format independently of the destination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been working on a v2 of ZeroLog, and I'm currently in that weird no-man's land where I'm not sure if I changed too much or not enough... I's clearly not finished, but I'd like to have your input @rbouallou @MendelMonteiro @rverdier @farnyser about the new design.
Here are the main changes:
General
Loggers
InfoFormat(etc) methods have been removed, they are replaced by the new interpolated string handlers feature of C# 10 😍, which means the following code:ILogEventinterface has been removed, it's replaced by theLogMessageclass, in order to remove lots of interface calls.ILoginterface has been removed, it's replaced by theLogclass, for the same reason. It made sense to have aLog/LogMessagepair of classes. There is now a single implementation instead of 3.LogManager.GetLoggerbefore theLogManageris initialized will return aLogobject which will work as soon as the log manager is initialized (it previously returned a no-op object which could never work).LogEventArgumentExhaustionStrategyhas been removed. We now always truncate (it didn't work if the buffer was exceeded previously anyway).Appenders
FormattedLogMessageclass which represents a formatted message (the logic was inLogManagerpreviously). TheIAppenderAPI has been changed to account of this.ISpanFormattable) that let us format values into aSpan<char>. That one required a lot of changes... 😰TODO
.Append($"...")DateOnly/TimeOnlyEnsure a message is not enqueued multiple times