3 Star 5 Fork 5

三三物联网/ssiot-core

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
options.go 895 Bytes
Copy Edit Raw Blame History
zou qinqin authored 2023-03-02 17:42 +08:00 . 修改模块名
package zap
import (
"io"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gitee.com/sansaniot/sansan-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)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.5.0

Search