Skip to content
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

Fix level casing when length set to 5 and more #135

Closed
wants to merge 1 commit into from

Conversation

sungam3r
Copy link
Contributor

fixes #76

#76 (comment) - @nblumhardt yes, fix is rather simple.

Also I would like to note that all that formatting code jumping around strings can be rewritten to allocate less memory. In ideal GetLevelMoniker should not allocate at all. It's not hard - just to add additional entries into 3 tables inside LevelOutputFormat. I do not know why it was not done before.

@nblumhardt
Copy link
Member

Perhaps we should pull in the version we use in Serilog? It's had bake time that we might benefit from:

https://github.com/serilog/serilog/blob/dev/src/Serilog/Formatting/Display/LevelOutputFormat.cs

@nblumhardt
Copy link
Member

Ah and I see the other version appears to avoid those allocations 👍

@sungam3r
Copy link
Contributor Author

OK but I would copy added tests into #137

nblumhardt added a commit to nblumhardt/serilog-sinks-console that referenced this pull request Feb 3, 2023
@nblumhardt
Copy link
Member

Done, thanks @sungam3r

@nblumhardt nblumhardt closed this Feb 3, 2023
@sungam3r sungam3r deleted the fix branch February 3, 2023 15:37
@nblumhardt nblumhardt mentioned this pull request Nov 9, 2023
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.

Level casing when length set to 5 and more
2 participants