Documentation ¶
Index ¶
- Variables
- func C(ctx context.Context) *zapLogger
- func Debugw(msg string, keysAndValues ...interface{})
- func Errorw(msg string, keysAndValues ...interface{})
- func Fatalw(msg string, keysAndValues ...interface{})
- func Infow(msg string, keysAndValues ...interface{})
- func Init(opts *Options)
- func NewChannel(c *Options) *zap.Logger
- func NewLogger(opts *Options) *zapLogger
- func Panicw(msg string, keysAndValues ...interface{})
- func Sync()
- func Warnw(msg string, keysAndValues ...interface{})
- type Logger
- type Options
Constants ¶
This section is empty.
Variables ¶
View Source
var ( XRequestIDKey = "X-Request-ID" XUsernameKey = "X-Username" )
View Source
var (
MaxBackups = 3
)
Functions ¶
func NewChannel ¶
Types ¶
type Logger ¶
type Logger interface { Debugw(msg string, keysAndValues ...interface{}) Infow(msg string, keysAndValues ...interface{}) Warnw(msg string, keysAndValues ...interface{}) Errorw(msg string, keysAndValues ...interface{}) Panicw(msg string, keysAndValues ...interface{}) Fatalw(msg string, keysAndValues ...interface{}) Sync() }
type Options ¶
type Options struct { Level string `mapstructure:"level" json:"level" yaml:"level"` Days int `mapstructure:"days" json:"days" yaml:"days"` Console bool `mapstructure:"console" json:"console" yaml:"console"` Format string `mapstructure:"format" json:"format" yaml:"format"` MaxSize int `mapstructure:"maxSize" json:"maxSize" yaml:"maxSize"` Compress bool `mapstructure:"compress" json:"compress" yaml:"compress"` Path string `mapstructure:"path" json:"path" yaml:"path"` }
func NewDefaultOptions ¶
func NewDefaultOptions() *Options
Click to show internal directories.
Click to hide internal directories.