fix log level helper (#1342)

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-03-13 17:36:42 +03:00 committed by GitHub
parent fbde872e7f
commit 3543b275e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,8 @@
package logger package logger
import "os" import (
"os"
)
type Helper struct { type Helper struct {
Logger Logger

View File

@ -116,11 +116,11 @@ func Fatalf(template string, args ...interface{}) {
os.Exit(1) os.Exit(1)
} }
// Returns true if the given level is at or above the current logger level // Returns true if the given level is at or lower the current logger level
func V(lvl Level, log Logger) bool { func V(lvl Level, log Logger) bool {
l := DefaultLogger l := DefaultLogger
if log != nil { if log != nil {
l = log l = log
} }
return l.Options().Level >= lvl return l.Options().Level <= lvl
} }