log

package
v1.2.2-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel = "debug" // default level
	InfoLevel  = "info"
	WarnLevel  = "warn"
	ErrorLevel = "error"
)

log level

Variables

This section is empty.

Functions

func Error

func Error(args ...any)

func Info

func Info(args ...any)

func Warn

func Warn(args ...any)

Types

type Log

type Log struct {
	*logrus.Logger
	LogWriter
}

Log log

func GetLog added in v1.2.1

func GetLog() *Log

GetLog get once log

func NewLog

func NewLog() *Log

NewLog new log

func (*Log) ConfigLog added in v1.2.1

func (l *Log) ConfigLog(options *Options)

ConfigLog init log config store log to file options:

&log.Options{
		LogPath:      "log/",
		LogFileName:  "app.log",
		MaxNum:       uint(7),
		RotationTime: ctime.Day,
	}

type LogWriter

type LogWriter interface {
	Println(v ...any)
}

LogWriter log writer interface

type Options added in v1.2.1

type Options struct {
	LogPath      string
	LogFileName  string
	MaxNum       uint
	RotationTime time.Duration
}

Jump to

Keyboard shortcuts

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