fix log level helper (#1342)
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
fbde872e7f
commit
3543b275e0
@ -1,6 +1,8 @@
|
|||||||
package logger
|
package logger
|
||||||
|
|
||||||
import "os"
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
type Helper struct {
|
type Helper struct {
|
||||||
Logger
|
Logger
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user