// Copyright 2019 getensh.com. All rights reserved. // Use of this source code is governed by getensh.com. package tasker import "go.uber.org/zap" var l *zap.Logger // 日志器 // Init 注册日志器 func SetLogger(logger *zap.Logger) { l = logger } // LogError 写error日志 func LogError(msg string, fields ...zap.Field) { if l != nil { l.Info(msg, fields...) } } // LogInfo 写info日志 func LogInfo(msg string, fields ...zap.Field) { if l != nil { l.Info(msg, fields...) } } // LogDebug 写debug日志 func LogDebug(msg string, fields ...zap.Field) { if l != nil { l.Info(msg, fields...) } }