Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Log = Manager.Log
View Source
var Manager = NewLogger(zap.NewProductionConfig(), WithStackWithFmtFormatter(true))
View Source
var Sugar = Manager.Sugar
Functions ¶
func SetDevelopment ¶ added in v1.0.2
func SetDevelopment(enable bool)
Types ¶
type LoaderFactory ¶
type LoaderFactory struct { // ConfLoader.Reload 的包装函数 ReloadApply func(key string, confStruct interface{}) // ConfLoader.Provide 的包装函数 ProvideApply func() (key string, confStruct interface{}) }
LoaderFactory ConfLoader 工厂,用于生成需要动态包装的 ConfLoader 实现
@implement ConfLoader
func (LoaderFactory) Provide ¶
func (l LoaderFactory) Provide() (key string, confStruct interface{})
func (LoaderFactory) Reload ¶
func (l LoaderFactory) Reload(key string, confStruct interface{})
type Logger ¶
type Logger struct { Log *zap.Logger Sugar *zap.SugaredLogger Level zap.AtomicLevel // contains filtered or unexported fields }
Logger 具体Log的持有类
func (*Logger) ReloadFactory ¶
func (l *Logger) ReloadFactory(k string, onReloadeds ...func()) LoaderFactory
func (*Logger) SetDevelopment ¶
SetDevelopment 是否开启开发者模式 true为development mode 否则为production mode
development mode: zap.NewDevelopmentConfig()模式 production mode:zap.NewProductionConfig()模式 @receiver l @param enable
type Option ¶
type Option func(options *Options)
func WithStackWithFmtFormatter ¶
WithStackWithFmtFormatter 是否使用 fmt.Formatter 替换zap原本的stacktrace
@param stackWithFmtFormatter @return Option
type Options ¶
type Options struct {
StackWithFmtFormatter bool // 是否使用 fmt.Formatter 替换zap原本的stacktrace
}
Click to show internal directories.
Click to hide internal directories.