Documentation
¶
Index ¶
- func DPanicc(ctx context.Context, format string, args ...interface{})
- func DPanicf(format string, args ...interface{})
- func Debugc(ctx context.Context, format string, args ...interface{})
- func Debugf(format string, args ...interface{})
- func Error(msg string)
- func ErrorW(format string, args ...interface{})
- func Errorc(ctx context.Context, format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func Fatalc(ctx context.Context, format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Info(args ...interface{})
- func InfoW(format string, args ...interface{})
- func Infoc(ctx context.Context, format string, args ...interface{})
- func Infof(format string, args ...interface{})
- func Panicc(ctx context.Context, format string, args ...interface{})
- func Panicf(format string, args ...interface{})
- func ParseLevel(lvl string) zapcore.Level
- func Warnc(ctx context.Context, format string, args ...interface{})
- func Warnf(format string, args ...interface{})
- func WithFields(field Field) *zap.SugaredLogger
- type Config
- type Field
- type Logger
- type LoggerOptions
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseLevel ¶
func WithFields ¶
func WithFields(field Field) *zap.SugaredLogger
Types ¶
type Config ¶
type Config struct { Output string // 日志的位置 file|both|stdout Level string Format string ReportCaller bool Stacktrace bool ErrStats bool File string MaxSize int // 单个文件最大size MaxAge int // 保留旧文件的最大天数 BackupCount int // 保留旧文件的最大个数 Compress bool // 是否压缩/归档旧文件 }
func (*Config) IsBothFileStdout ¶
func (*Config) IsOutStdout ¶
type Logger ¶
type Logger interface { Error(msg string) Debugf(string, ...interface{}) Infof(string, ...interface{}) Info(...interface{}) InfoW(string, ...interface{}) Warnf(string, ...interface{}) WarnW(string, ...interface{}) Errorf(string, ...interface{}) ErrorW(string, ...interface{}) DPanicf(string, ...interface{}) Panicf(string, ...interface{}) Fatalf(string, ...interface{}) Debugc(context.Context, string, ...interface{}) Infoc(context.Context, string, ...interface{}) Warnc(context.Context, string, ...interface{}) Errorc(context.Context, string, ...interface{}) DPanicc(context.Context, string, ...interface{}) Panicc(context.Context, string, ...interface{}) Fatalc(context.Context, string, ...interface{}) WithFields(Field) *zap.SugaredLogger }
func NewNullLogger ¶
func NewNullLogger() Logger
type LoggerOptions ¶
type LoggerOptions struct{}
func (LoggerOptions) WithDebug ¶
func (LoggerOptions) WithDebug(debug bool) Option
func (LoggerOptions) WithLoggerConf ¶
func (LoggerOptions) WithLoggerConf(conf config.Config) Option
Click to show internal directories.
Click to hide internal directories.