Commit
This commit is contained in:
27
utils/log.go
27
utils/log.go
@@ -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...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user