rs / zerolog

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

Field LogLevel at Logger, Context & Event Levels #455

Closed vaguecoder closed 2 years ago

vaguecoder commented 2 years ago

Field LogLevel explicitly adds/replaces the log level to logs as per previous Logger, Context or Event. This only helps in printing and not changing log level.

  1. If the item with key level doesn't exist, LogLevel will add new with log level string as value.
  2. If level already exists but value differs, this will replace value.
  3. If both key and value match, no change.

This will help in closing #398

rs commented 2 years ago

I'm going to refuse this PR: