logger

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Lg *zap.Logger
)

Functions

func Debug

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

Debug 通用 debug 日志方法

func Error

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

Error 通用 error 日志方法

func Fatal

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

Fatal 通用 fatal 日志方法

func Info

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

Info 通用 info 日志方法

func Init

func Init(cfg *LogConfig, mode string) (err error)

Init 初始化logger

func Panic

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

Panic 通用 panic 日志方法

func Sync

func Sync()

Sync 刷新缓冲区

func Warn

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

Warn 通用 warn 日志方法

Types

type LogConfig

type LogConfig struct {
	Level      string `mapstructure:"level"`
	Filename   string `mapstructure:"filename"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxAge     int    `mapstructure:"max_age"`
	MaxBackups int    `mapstructure:"max_backups"`
	Daily      bool   `mapstructure:"daily"`
}

Jump to

Keyboard shortcuts

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