Documentation
¶
Index ¶
Constants ¶
View Source
const ConfigKey = "zap"
ConfigKey for this repo
Variables ¶
View Source
var Factory *tao.BaseFactory[*zap.SugaredLogger]
Factory is the global factory instance for managing zap.SugaredLogger
View Source
var Z = &Config{}
Z is the global config instance for tao-zap
Functions ¶
func NewZap ¶ added in v0.2.0
func NewZap(name string, config InstanceConfig) (*zap.SugaredLogger, func() error, error)
NewZap creates a new Zap logger for factory pattern
Types ¶
type Config ¶
type Config struct {
tao.BaseMultiConfig[InstanceConfig]
RunAfters []string `json:"run_after,omitempty" yaml:"run_after,omitempty"`
}
Config 总配置,实现 tao.MultiConfig 接口
type InstanceConfig ¶ added in v0.2.0
type InstanceConfig struct {
Logs map[LogType]*LogConfig `json:"logs"`
CallDepth int `json:"call_depth"`
Coexist bool `json:"coexist"`
}
InstanceConfig 单实例配置
Click to show internal directories.
Click to hide internal directories.