elog

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogDir     string // electron-egg logs directory
	LogName    = "github.com/wallace5303/ee-go.log"
	Logger     *zap.SugaredLogger
	CoreLogger *zap.SugaredLogger
)

Functions

func GetZLog

func GetZLog(cfg map[string]any) *zap.Logger

func InitCoreLog

func InitCoreLog(cfg map[string]any)

func InitLog

func InitLog(cfg map[string]any)

[todo] 跨天情况待测试

func SetLogDir

func SetLogDir(path string)

Types

type LogConfig

type LogConfig struct {
	OutputJSON bool   `json:"outputJson"`
	Level      string `json:"level"`    // Level 最低日志等级,DEBUG<INFO<WARN<ERROR<FATAL 例如:info-->收集info等级以上的日志
	FileName   string `json:"fileName"` // FileName 日志文件位置
	MaxSize    int    `json:"maxSize"`  // MaxSize 进行切割之前,日志文件的最大大小(MB为单位),默认为100MB
	MaxAge     int    `json:"maxAge"`   // MaxAge 是根据文件名中编码的时间戳保留旧日志文件的最大天数。
}

Jump to

Keyboard shortcuts

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