add helper function to determine logger level (#1321)
* add helper function to determine logger level Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
1a4f608ed1
commit
241614ff68
@ -115,3 +115,12 @@ func Fatalf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(FatalLevel, template, args...)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Returns true if the given level is at or above the current logger level
|
||||
func V(lvl Level, log Logger) bool {
|
||||
l := DefaultLogger
|
||||
if log != nil {
|
||||
l = log
|
||||
}
|
||||
return l.Options().Level >= lvl
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user