logger

package
v0.0.0-...-208d128 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, fields ...zap.Field)

func DebugF

func DebugF(msg string, args ...interface{})

func Error

func Error(msg string, fields ...zap.Field)

func ErrorF

func ErrorF(msg string, args ...interface{})

func Fatal

func Fatal(msg string, fields ...zap.Field)

func FatalF

func FatalF(msg string, args ...interface{})

func Info

func Info(msg string, fields ...zap.Field)

func InfoF

func InfoF(msg string, args ...interface{})

func Warn

func Warn(msg string, fields ...zap.Field)

func WarnF

func WarnF(msg string, args ...interface{})

Types

type LogConfig

type LogConfig struct {
	Level      string `json:"level"`       // Level 最低日志等级,DEBUG<INFO<WARN<ERROR<FATAL 例如:info-->收集info等级以上的日志
	FileName   string `json:"file_name"`   // FileName 日志文件位置
	MaxSize    int    `json:"max_size"`    // MaxSize 进行切割之前,日志文件的最大大小(MB为单位),默认为100MB
	MaxAge     int    `json:"max_age"`     // MaxAge 是根据文件名中编码的时间戳保留旧日志文件的最大天数。
	MaxBackups int    `json:"max_backups"` // MaxBackups 是要保留的旧日志文件的最大数量。默认是保留所有旧的日志文件(尽管 MaxAge 可能仍会导致它们被删除。)
}

type Logger

type Logger struct {
	*zap.Logger
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(cfg *LogConfig) *Logger

func (*Logger) Init

func (l *Logger) Init()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL