goc/pkg/log/log.go
lyyyuna 456c883987 重构
1. 去掉全局的配置 config
2. 合并 pkg/build, pkg/flag, pkg/cover, pkg/config 几个包(这几个包有强相关性,适合放一处。并且分开也容易造成循环依赖)
2021-09-02 14:43:08 +08:00

54 lines
800 B
Go

package log
import (
"go.uber.org/zap/zapcore"
)
var g Logger
func NewLogger(debug bool) {
if debug == true {
g = newCiLogger()
} else {
g = &terminalLogger{
level: zapcore.InfoLevel,
}
}
}
func Debugf(format string, args ...interface{}) {
g.Debugf(format, args...)
}
func Donef(format string, args ...interface{}) {
g.Donef(format, args...)
}
func Infof(format string, args ...interface{}) {
g.Infof(format, args...)
}
func Warnf(format string, args ...interface{}) {
g.Warnf(format, args...)
}
func Fatalf(format string, args ...interface{}) {
g.Fatalf(format, args...)
}
func Errorf(format string, args ...interface{}) {
g.Errorf(format, args...)
}
func StartWait(message string) {
g.StartWait(message)
}
func StopWait() {
g.StopWait()
}
func Sync() {
g.Sync()
}