Skip to content

Commit

Permalink
Update providers/phuslog/logger.go
Browse files Browse the repository at this point in the history
fallback to error when no level is detected.
Add unknown level With to log and log error message
  • Loading branch information
ogimenezb authored Jun 18, 2021
1 parent 63be7b4 commit ceaff62
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions providers/phuslog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ func (l *Logger) Log(lvl logging.Level, msg string) {
case logging.ERROR:
l.Error(msg)
default:
// TODO(kb): Perhaps this should be a logged warning, defaulting to ERROR to get attention
// without interrupting code flow?
panic(fmt.Sprintf("phuslog: unknown level %s", lvl))
l.With("error-lvl", fmt.Sprintf("phuslog: unknown level %s", lvl)).Log(logging.ERROR, msg)
}
}

Expand Down

0 comments on commit ceaff62

Please sign in to comment.