zk logger

This commit is contained in:
withchao
2023-06-20 15:12:35 +08:00
parent fbbd651f05
commit fe08e8b6c9
4 changed files with 24 additions and 20 deletions
+12
View File
@@ -44,18 +44,30 @@ func InitFromConfig(loggerPrefixName, moduleName string, logLevel int, isStdout
}
func ZDebug(ctx context.Context, msg string, keysAndValues ...interface{}) {
if pkgLogger == nil {
return
}
pkgLogger.Debug(ctx, msg, keysAndValues...)
}
func ZInfo(ctx context.Context, msg string, keysAndValues ...interface{}) {
if pkgLogger == nil {
return
}
pkgLogger.Info(ctx, msg, keysAndValues...)
}
func ZWarn(ctx context.Context, msg string, err error, keysAndValues ...interface{}) {
if pkgLogger == nil {
return
}
pkgLogger.Warn(ctx, msg, err, keysAndValues...)
}
func ZError(ctx context.Context, msg string, err error, keysAndValues ...interface{}) {
if pkgLogger == nil {
return
}
pkgLogger.Error(ctx, msg, err, keysAndValues...)
}