This commit is contained in:
fallen-angle
2022-01-20 16:49:37 +08:00
parent 2280679053
commit 582807ae10
13 changed files with 182 additions and 16 deletions

View File

@@ -14,13 +14,9 @@ func RequestLogWarn(args ...interface{}) {
logWarn("request", args...)
}
func RequestLogPanic(args ...interface{}) {
logPanic("request", args...)
}
func InitLogPanic(component string, args ...interface{}) {
func InitLogError(component string, args ...interface{}) {
args = append(args, "component", component)
logPanic("initialize", args...)
logError("initialize", args...)
}
func InitLogInfo(component string, args ...interface{}) {
@@ -28,6 +24,21 @@ func InitLogInfo(component string, args ...interface{}) {
logInfo("initialize", args...)
}
func UtilLogInfo(utilName string, args ...interface{}) {
args = append(args, "util", utilName)
logInfo("util", args...)
}
func UtilLogError(utilName string, args ...interface{}) {
args = append(args, "util", utilName)
logError("util", args...)
}
func UtilLogWarn(utilName string, args ...interface{}) {
args = append(args, "util", utilName)
logWarn("util", args...)
}
func logInfo(msg string, args ...interface{}) {
global.Logger.Infow(msg, args...)
}
@@ -39,7 +50,3 @@ func logError(msg string, args ...interface{}) {
func logWarn(msg string, args ...interface{}) {
global.Logger.Warnw(msg, args...)
}
func logPanic(msg string, args ...interface{}) {
global.Logger.Panicw("", args...)
}