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()
2021-11-01 18:07:05 +00:00
func Sub(sys string) *Logger {
2021-11-01 14:41:11 +00:00
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...)
}