Documentation ¶
Index ¶
Constants ¶
View Source
const ConfigFileName = "zap.yaml"
Variables ¶
View Source
var CONFIG = Zap{ Level: "debug", Format: "console", Prefix: "[IRIS-ADMIN]", Director: "logs", LinkName: "latest_log", ShowLine: true, EncodeLevel: "LowercaseColorLevelEncoder", StacktraceKey: "stacktrace", LogInConsole: false, }
View Source
var (
ZAPLOG *zap.Logger
)
level 日志级别
Functions ¶
func GetWriteSyncer ¶
func GetWriteSyncer() (zapcore.WriteSyncer, error)
GetWriteSyncer zap logger中加入file-rotatelogs
Types ¶
type StringsArray ¶
type StringsArray [][]string
func (StringsArray) MarshalLogArray ¶
func (ss StringsArray) MarshalLogArray(arr zapcore.ArrayEncoder) error
MarshalLogArray 序列化数组日志
type Zap ¶
type Zap struct { Level string `mapstructure:"level" json:"level" yaml:"level"` //debug ,info,warn,error,panic,fatal Format string `mapstructure:"format" json:"format" yaml:"format"` Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` Director string `mapstructure:"director" json:"director" yaml:"director"` LinkName string `mapstructure:"link-name" json:"linkName" yaml:"link-name"` ShowLine bool `mapstructure:"show-line" json:"showLine" yaml:"show-line"` EncodeLevel string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"` StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"` LogInConsole bool `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"` }
Click to show internal directories.
Click to hide internal directories.