log

package
v2.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Alert

func Alert(a ...interface{})

func AlertF

func AlertF(format string, v ...interface{})

func Debug

func Debug(a ...interface{})

func DebugF

func DebugF(format string, v ...interface{})

func Error

func Error(a ...interface{})

func ErrorF

func ErrorF(format string, v ...interface{})

func Info

func Info(a ...interface{})

func InfoF

func InfoF(format string, v ...interface{})

func LoadConsole

func LoadConsole(cfg Config) (err *data.CodeError)

func LoadFileLogger

func LoadFileLogger(cfg Config) (err *data.CodeError)

func Prepare

func Prepare() *data.CodeError

func Warning

func Warning(a ...interface{})

func WarningF

func WarningF(format string, v ...interface{})

Types

type Config

type Config struct {
	Filename       string `json:"filename"`
	Level          int    `json:"level"`
	Daily          bool   `json:"daily"`
	MaxDays        int    `json:"maxdays"`
	StdOutColorful bool   `json:"color"`
	EnableStdout   bool   `json:"-"`
}

func (*Config) ToJson

func (c *Config) ToJson() string

type Level

type Level = int
const (
	LevelAlert   Level = logs.LevelAlert
	LevelError   Level = logs.LevelError
	LevelWarning Level = logs.LevelWarning
	LevelInfo    Level = logs.LevelInformational
	LevelDebug   Level = logs.LevelDebug
	LevelNone    Level = 100000 // 不输出日志
)

Jump to

Keyboard shortcuts

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