mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 16:37:24 +02:00
config: validate log levels (#4367)
* config: validate log levels * fix SetLevel * document unset, merge warn/warning
This commit is contained in:
parent
a1388592d8
commit
78e7a3e7d0
8 changed files with 152 additions and 30 deletions
|
@ -134,19 +134,19 @@ func Example() {
|
|||
|
||||
func ExampleSetLevel() {
|
||||
setup()
|
||||
log.SetLevel("info")
|
||||
log.SetLevel(zerolog.InfoLevel)
|
||||
log.Debug(context.Background()).Msg("Debug")
|
||||
log.Info(context.Background()).Msg("Debug or Info")
|
||||
log.SetLevel("warn")
|
||||
log.SetLevel(zerolog.WarnLevel)
|
||||
log.Debug(context.Background()).Msg("Debug")
|
||||
log.Info(context.Background()).Msg("Debug or Info")
|
||||
log.Warn(context.Background()).Msg("Debug or Info or Warn")
|
||||
log.SetLevel("error")
|
||||
log.SetLevel(zerolog.ErrorLevel)
|
||||
log.Debug(context.Background()).Msg("Debug")
|
||||
log.Info(context.Background()).Msg("Debug or Info")
|
||||
log.Warn(context.Background()).Msg("Debug or Info or Warn")
|
||||
log.Error(context.Background()).Msg("Debug or Info or Warn or Error")
|
||||
log.SetLevel("default-fall-through")
|
||||
log.SetLevel(zerolog.DebugLevel)
|
||||
log.Debug(context.Background()).Msg("Debug")
|
||||
|
||||
// Output:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue