12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package zap
- import (
- "io"
- "go.uber.org/zap"
- "go.uber.org/zap/zapcore"
- "gogs.baozhida.cn/zoie/OAuth-core/logger"
- )
- type Options struct {
- logger.Options
- }
- type callerSkipKey struct{}
- func WithCallerSkip(i int) logger.Option {
- return logger.SetOption(callerSkipKey{}, i)
- }
- type configKey struct{}
- // WithConfig pass zap.Config to logger
- func WithConfig(c zap.Config) logger.Option {
- return logger.SetOption(configKey{}, c)
- }
- type encoderConfigKey struct{}
- // WithEncoderConfig pass zapcore.EncoderConfig to logger
- func WithEncoderConfig(c zapcore.EncoderConfig) logger.Option {
- return logger.SetOption(encoderConfigKey{}, c)
- }
- type namespaceKey struct{}
- func WithNamespace(namespace string) logger.Option {
- return logger.SetOption(namespaceKey{}, namespace)
- }
- type writerKey struct{}
- func WithOutput(out io.Writer) logger.Option {
- return logger.SetOption(writerKey{}, out)
- }
|