Documentation
¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func Infof(format string, args ...interface{})
- func NewLog(conf *Config) *zap.Logger
- func Warn(args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithContext(ctx context.Context) *zap.SugaredLogger
- type Config
- type Logger
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithContext ¶
func WithContext(ctx context.Context) *zap.SugaredLogger
Types ¶
type Config ¶
type Config struct {
Output string `toml:"output"` // "stdout", "file", "kafka" ...
Level string `toml:"level"` // "DEBUG", "INFO", "WARNING", ...
Path string `toml:"path"` // 日志写入目录或文件
KeepHours int `toml:"keepHours"` // 轮转保留时长(小时)
RotateNum int `toml:"rotateNum"` // 轮转数量
RotateSize int `toml:"rotateSize"` // 单个文件大小上限(MB)
}
Config holds LogConfig configuration options.
type Logger ¶
type Logger struct {
Log *zap.SugaredLogger
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.