klog/std.go

56 lines
994 B
Go
Raw Normal View History

2021-11-01 14:41:11 +00:00
package log
var std = Default()
func Sub(sys string) *logger {
return std.Sub(sys)
}
func ErrorF(fields H, v ...interface{}) {
if PROD {
std.output(terror, 3, "", fields, v...)
} else {
std.output(terror, 3, stack(), fields, v...)
}
}
func Error(v ...interface{}) {
if PROD {
std.output(terror, 3, "", H{}, v...)
} else {
std.output(terror, 3, stack(), H{}, v...)
}
}
func DebugF(fields H, v ...interface{}) {
if PROD {
std.output(tdebug, 3, "", fields, v...)
} else {
std.output(tdebug, 3, stack(), fields, v...)
}
}
func Debug(v ...interface{}) {
if PROD {
std.output(tdebug, 3, "", H{}, v...)
} else {
std.output(tdebug, 3, stack(), H{}, v...)
}
}
func WarnF(fields H, v ...interface{}) {
std.output(twarn, 3, "", fields, v...)
}
func Warn(v ...interface{}) {
std.output(twarn, 3, "", H{}, v...)
}
func InfoF(fields H, v ...interface{}) {
std.output(tinfo, 3, "", fields, v...)
}
func Info(v ...interface{}) {
std.output(tinfo, 3, "", H{}, v...)
}