Documentation ¶
Index ¶
Constants ¶
View Source
const (
// MsgUKey defines this message uniq key to make diff
MsgUKey = "ukey"
)
Variables ¶
View Source
var ( // Logger is the default logger Logger *zap.Logger )
Functions ¶
func InitDefault ¶
InitDefault init default logger
func NewDiffCore ¶
func NewDiffCore(enc zapcore.Encoder, ws zapcore.WriteSyncer, enab zapcore.LevelEnabler, cacheSize int, opts ...Option) zapcore.Core
NewDiffCore creates a Core only output logs when different.
Types ¶
type Config ¶
type Config struct { Level zap.AtomicLevel `json:"level"` Sink lumberjack.Logger `json:"sink"` Encoding string `json:"encoding"` EncoderConfig zapcore.EncoderConfig `json:"encoderConfig"` // Whether to use diffCore DiffCore bool `json:"diffCore"` DiffCacheSize int `json:"diffCacheSize"` GlogMux bool `json:"glogMux"` }
Config configs for zap logger
func LoadConfigFile ¶
LoadConfigFile load config from file
Click to show internal directories.
Click to hide internal directories.