Documentation ¶
Index ¶
- Constants
- func FieldContext(ctx context.Context) log.Field
- func FieldError(err error) log.Field
- func FieldInt32(key string, val int32) log.Field
- func FieldInt64(key string, val int64) log.Field
- func FieldInterface(key string, val interface{}) log.Field
- func FieldMap(items map[string]interface{}) log.Field
- func FieldString(key string, val string) log.Field
- func New(loggerConf *Config) (log.Logger, func(), error)
- func NewDevNullLog(w io.Writer) log.Logger
- func NewFields() log.IField
- func NewTextEncoder(config zapcore.EncoderConfig) zapcore.Encoder
- type Config
- type File
Constants ¶
View Source
const (
OutSep = ","
)
Variables ¶
This section is empty.
Functions ¶
func FieldError ¶
func FieldInterface ¶
func NewTextEncoder ¶
func NewTextEncoder(config zapcore.EncoderConfig) zapcore.Encoder
Types ¶
type Config ¶
type Config struct { Out string `json:"out,omitempty"` Level string `json:"level,omitempty"` File *File `json:"file,omitempty"` Type string `json:"type,omitempty"` // 默认:0-default, 1-simple Model int32 `json:"model,omitempty"` }
Config 日志配置
type File ¶
type File struct { Path string `json:"path,omitempty"` FileName string `json:"file_name,omitempty"` MaxSize int32 `json:"max_size,omitempty"` MaxBackups int32 `json:"max_backups,omitempty"` MaxAge int32 `json:"max_age,omitempty"` Compress bool `json:"compress,omitempty"` }
func (*File) GetCompress ¶
func (*File) GetFileName ¶
func (*File) GetMaxBackups ¶
func (*File) GetMaxSize ¶
Click to show internal directories.
Click to hide internal directories.