3 Star 3 Fork 1

三三物联网 / ssiot-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
options.go 894 Bytes
一键复制 编辑 原始数据 按行查看 历史
三三物联网 提交于 2023-04-03 00:22 . 重构
package zap
import (
"io"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gitee.com/sansaniot/ssiot-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)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.7.3

搜索帮助

344bd9b3 5694891 D2dac590 5694891