logger

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, v ...interface{})

func Err

func Err(err error)

func Error

func Error(msg string, v ...interface{})

func Info

func Info(msg string, v ...interface{})

func PanicIfErr

func PanicIfErr(err error)

func Warn

func Warn(msg string, v ...interface{})

Types

type CompressConfig

type CompressConfig struct {
	Enable     bool `mapstructure:"enable" json:"enable" yaml:"enable"`               // 是否开启
	MaxSize    int  `mapstructure:"max-size" json:"MaxSize" yaml:"max-size"`          // 在进行切割之前,日志文件的最大大小(以MB为单位)
	MaxBackups int  `mapstructure:"max-backups" json:"maxBackups" yaml:"max-backups"` // 保留旧文件的最大个数
	MaxAge     int  `mapstructure:"max-age" json:"maxAge" yaml:"max-age"`             // 保留旧文件的最大天数
}

type LoggerConfig

type LoggerConfig struct {
	Enable         bool           `mapstructure:"enable" json:"enable" yaml:"enable"`                              // 是否启用
	Level          string         `mapstructure:"level" json:"level" yaml:"level"`                                 // 级别
	LogGinAccess   bool           `mapstructure:"log-gin-access" json:"logGinAccess" yaml:"log-gin-access"`        // 是否记录gin的日志
	Directory      string         `mapstructure:"directory" json:"directory"  yaml:"directory"`                    // 日志文件夹
	FileNamePrefix string         `mapstructure:"file-name-prefix" json:"fileNamePrefix"  yaml:"file-name-prefix"` // 日志文件前缀
	Compress       CompressConfig `mapstructure:"compress" json:"compress"  yaml:"compress"`                       // 日志文件压缩归档
}

func (LoggerConfig) Load

func (c LoggerConfig) Load()

Jump to

Keyboard shortcuts

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