rs / zerolog

Zero Allocation JSON Logger
MIT License
10.41k stars 567 forks source link

Upper Case Log Levels #522

Closed mvrahden closed 1 year ago

mvrahden commented 1 year ago

The following commit introduced a bug for parsing log levels.

Please see my comment: https://github.com/rs/zerolog/commit/3543e9d94bc5ed088dd2d9ad1d19c7ccd0fa65f5#commitcomment-100418502

Proposed Solution

My suggestion is to revert the ParseLevel function to what it was before and instead introduce a ParseLevelEqualFold or ParseLevelCaseInsensitive or similar to the code base

I'd suggest to lower case all the switch cases as well. Which will allow users to have the intended behaviour by one single function.

rs commented 1 year ago

Please send a PR

mvrahden commented 1 year ago

Please find the PR here: https://github.com/rs/zerolog/pull/523

mitar commented 1 year ago

523 has been merged, I think this can be closed now.