logs

package
v0.0.0-...-b9dc9a6 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger      = logs.NewLogger(10000) //初始化日志变量(缓存大小为10000)
	Alertloger  = logs.NewLogger(10000)
	Originloger = logs.NewLogger(10000)
	Panic       = logs.NewLogger(10000)
)

log的简单用法:1 NewLogger 2SetLogger设置logger 3就直接能用了,如log.Debug()等

View Source
var (
	// default log dir
	LogDir = "log"
	// log to file config
	// log file will auto rotate, keeping logs for last two weeks
	DefaultFileLoggerConfig = FileLoggerConfig{
		Filename: "log/alert-gateway.log",
		MaxFiles: 14,
		MaxSize:  1 << 26,
		Daily:    true,
		MaxDays:  14,
		Rotate:   true,
		Level:    logs.LevelTrace,
	}
)

Functions

func Critical

func Critical(f interface{}, v ...interface{})

func Debug

func Debug(f interface{}, v ...interface{})

func Error

func Error(f interface{}, v ...interface{})

func Info

func Info(f interface{}, v ...interface{})

func Notice

func Notice(f interface{}, v ...interface{})

func Warning

func Warning(f interface{}, v ...interface{})

Types

type FileLoggerConfig

type FileLoggerConfig struct {
	Filename string `json:"filename"`
	MaxFiles int    `json:"maxfiles"`
	MaxSize  int    `json:"maxsize"`
	Daily    bool   `json:"daily"`
	MaxDays  int64  `json:"maxdays"`
	Rotate   bool   `json:"rotate"`
	Level    int    `json:"level"`
}

Jump to

Keyboard shortcuts

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