log

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: LGPL-2.1 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConsoleOut

func AddConsoleOut(level int)

AddConsoleOut ...

func AddField

func AddField(key, value string)

AddField add log fields

func AddFileOut

func AddFileOut(logFilePath string, level, days int) (err error)

AddFileOut only support unix os

func DisableDefaultConsole

func DisableDefaultConsole()

DisableDefaultConsole 取消默认的控制台输出

func Err

func Err(err error)

Err print stack trace if possible

func ErrWithFields

func ErrWithFields(err error, inFields logrus.Fields)

ErrWithFields print stack trace if possible

func Fatal

func Fatal(err error)

Fatal = Err + exit(1)

func SetLogDetailsByConfig

func SetLogDetailsByConfig(app App, log Log)

Types

type App

type App struct {
	Name string `toml:"name"`
}

type Log

type Log struct {
	Stdout struct {
		Enable bool `toml:"enable"`
		Level  int  `toml:"level"`
	} `toml:"stdout"`
	File struct {
		Enable bool   `toml:"enable"`
		Level  int    `toml:"level"`
		Path   string `toml:"path"`
		MaxAge int    `toml:"max-age"`
	} `toml:"file"`
}

Jump to

Keyboard shortcuts

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