logger/log/say.go
2022-05-18 17:43:19 +08:00

76 lines
1.9 KiB
Go

package log
import "go.uber.org/zap"
// Debug uses fmt.Sprint to construct and log a message.
func Debug(args ...interface{}) {
defer zap.S().Sync()
zap.S().Debug(args...)
}
// Info uses fmt.Sprint to construct and log a message.
func Info(args ...interface{}) {
defer zap.S().Sync()
zap.S().Info(args...)
}
// Warn uses fmt.Sprint to construct and log a message.
func Warn(args ...interface{}) {
defer zap.S().Sync()
zap.S().Warn(args...)
}
// Error uses fmt.Sprint to construct and log a message.
func Error(args ...interface{}) {
defer zap.S().Sync()
zap.S().Error(args...)
}
// Panic uses fmt.Sprint to construct and log a message, then panics.
func Panic(args ...interface{}) {
defer zap.S().Sync()
zap.S().Panic(args...)
}
// Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
func Fatal(args ...interface{}) {
defer zap.S().Sync()
zap.S().Fatal(args...)
}
// Debugf uses fmt.Sprintf to log a templated message.
func Debugf(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Debugf(template, args...)
}
// Infof uses fmt.Sprintf to log a templated message.
func Infof(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Infof(template, args...)
}
// Warnf uses fmt.Sprintf to log a templated message.
func Warnf(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Warnf(template, args...)
}
// Errorf uses fmt.Sprintf to log a templated message.
func Errorf(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Errorf(template, args...)
}
// Panicf uses fmt.Sprintf to log a templated message, then panics.
func Panicf(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Panicf(template, args...)
}
// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func Fatalf(template string, args ...interface{}) {
defer zap.S().Sync()
zap.S().Fatalf(template, args...)
}