Documentation
¶
Index ¶
- func Debug(args ...interface{})
- func Debugf(template string, args ...interface{})
- func Debugw(msg string, keysAndValues ...interface{})
- func Error(args ...interface{})
- func Errorf(template string, args ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatal(args ...interface{})
- func Fatalf(template string, args ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Info(args ...interface{})
- func Infof(template string, args ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Internal() interface{}
- func Panic(args ...interface{})
- func Panicf(template string, args ...interface{})
- func Panicw(msg string, keysAndValues ...interface{})
- func Warn(args ...interface{})
- func Warnf(template string, args ...interface{})
- func Warnw(msg string, keysAndValues ...interface{})
- type Config
- type EncoderConfig
- type Logger
- func (logger *Logger) DPanic(args ...interface{})
- func (logger *Logger) DPanicf(template string, args ...interface{})
- func (logger *Logger) DPanicw(msg string, keysAndValues ...interface{})
- func (logger *Logger) Debug(args ...interface{})
- func (logger *Logger) Debugf(template string, args ...interface{})
- func (logger *Logger) Debugw(msg string, keysAndValues ...interface{})
- func (logger *Logger) Error(args ...interface{})
- func (logger *Logger) Errorf(template string, args ...interface{})
- func (logger *Logger) Errorw(msg string, keysAndValues ...interface{})
- func (logger *Logger) Fatal(args ...interface{})
- func (logger *Logger) Fatalf(template string, args ...interface{})
- func (logger *Logger) Fatalw(msg string, keysAndValues ...interface{})
- func (logger *Logger) Info(args ...interface{})
- func (logger *Logger) Infof(template string, args ...interface{})
- func (logger *Logger) Infow(msg string, keysAndValues ...interface{})
- func (logger *Logger) Internal() interface{}
- func (logger *Logger) Panic(args ...interface{})
- func (logger *Logger) Panicf(template string, args ...interface{})
- func (logger *Logger) Panicw(msg string, keysAndValues ...interface{})
- func (logger *Logger) String() string
- func (logger *Logger) Trace(ctx context.Context) *Logger
- func (logger *Logger) Warn(args ...interface{})
- func (logger *Logger) Warnf(template string, args ...interface{})
- func (logger *Logger) Warnw(msg string, keysAndValues ...interface{})
- type SamplingConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debugf ¶
func Debugf(template string, args ...interface{})
Debugf uses fmt.Sprintf to log a templated message.
func Debugw ¶
func Debugw(msg string, keysAndValues ...interface{})
Debugw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
When debug-level logging is disabled, this is much faster than
s.With(keysAndValues).Debug(msg)
func Errorf ¶
func Errorf(template string, args ...interface{})
Errorf uses fmt.Sprintf to log a templated message.
func Errorw ¶
func Errorw(msg string, keysAndValues ...interface{})
Errorw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func Fatal ¶
func Fatal(args ...interface{})
Fatal uses fmt.Sprint to construct and log a message, then calls os.Exit.
func Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
func Fatalw ¶
func Fatalw(msg string, keysAndValues ...interface{})
Fatalw logs a message with some additional context, then calls os.Exit. The variadic key-value pairs are treated as they are in With.
func Infof ¶
func Infof(template string, args ...interface{})
Infof uses fmt.Sprintf to log a templated message.
func Infow ¶
func Infow(msg string, keysAndValues ...interface{})
Infow logs a message with some additional context. The variadic key-value pairs are treated as they are in With.
func Panic ¶
func Panic(args ...interface{})
Panic uses fmt.Sprint to construct and log a message, then panics.
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf uses fmt.Sprintf to log a templated message, then panics.
func Panicw ¶
func Panicw(msg string, keysAndValues ...interface{})
Panicw logs a message with some additional context, then panics. The variadic key-value pairs are treated as they are in With.
Types ¶
type Config ¶
type Config struct {
WatchInterval time.Duration `config:"watchInterval" json:"watchInterval" desc:"config change watch interval, default is 5s"`
Level zap.AtomicLevel `config:"level" json:"level" desc:"debug,info,warn,error,panic,fatal"`
DisableCaller bool `config:"disableCaller" json:"disableCaller"`
DisableStacktrace bool `config:"disableStacktrace" json:"disableStacktrace"`
Sampling *SamplingConfig `config:"sampling" json:"sampling"`
Encoding string `config:"encoding" json:"encoding"`
EncoderConfig *EncoderConfig `config:"encoderConfig" json:"encoderConfig"`
OutputPaths []string `config:"outputPaths" json:"outputPaths"`
ErrorOutputPaths []string `config:"errorOutputPaths" json:"errorOutputPaths"`
InitialFields map[string]interface{} `config:"initialFields" json:"initialFields"`
Mask bool `config:"mask" json:"mask"`
MaskRules []core.MaskRule `config:"maskRules" json:"maskRules"`
// contains filtered or unexported fields
}
Config of logger
type EncoderConfig ¶ added in v1.0.0
type EncoderConfig struct {
MessageKey string `config:"messageKey" json:"messageKey"`
LevelKey string `config:"levelKey" json:"levelKey"`
TimeKey string `config:"timeKey" json:"timeKey"`
NameKey string `config:"nameKey" json:"nameKey"`
CallerKey string `config:"callerKey" json:"callerKey"`
StacktraceKey string `config:"stacktraceKey" json:"stacktraceKey"`
LineEnding string `config:"lineEnding" json:"lineEnding"`
EncodeLevel string `config:"levelEncoder" json:"levelEncoder"`
EncodeTime string `config:"timeEncoder" json:"timeEncoder"`
EncodeDuration string `config:"durationEncoder" json:"durationEncoder"`
EncodeCaller string `config:"callerEncoder" json:"callerEncoder"`
EncodeName string `config:"nameEncoder" json:"nameEncoder"`
}
EncoderConfig of logger
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logger option
type SamplingConfig ¶ added in v1.0.0
type SamplingConfig struct {
Initial int `config:"initial" json:"initial"`
Thereafter int `config:"thereafter" json:"thereafter"`
}
SamplingConfig of logger