Skip to content

Commit

Permalink
copied from @jmalloc
Browse files Browse the repository at this point in the history
  • Loading branch information
na4ma4 committed Apr 6, 2024
1 parent 28549ca commit 78c156c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions level.go
@@ -0,0 +1,12 @@
package zaptool

import "go.uber.org/zap/zapcore"

// ErrorLevel returns ErrorLevel if err is non-nil; otherwise, it returns
// InfoLevel.
func ErrorLevel(err error) zapcore.Level {
if err == nil {
return zapcore.InfoLevel
}
return zapcore.ErrorLevel
}

0 comments on commit 78c156c

Please sign in to comment.