log

package
v1.20.19 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: MIT Imports: 13 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 DefaultFileLog

func DefaultFileLog()

Default file log maintain 7 days data, every 24 hour split file

func Error

func Error(args ...interface{})

sugar

func Info

func Info(args ...interface{})

func Warn

func Warn(args ...interface{})

Types

type Log

type Log struct {
	*logrus.Logger
	LogWriter
}

log

func Logger

func Logger() *Log

one single log

func NewLog

func NewLog() *Log

new log

func (*Log) ErrorLine

func (l *Log) ErrorLine(args ...interface{})

print error line

func (*Log) FileLog

func (l *Log) FileLog(logPath string, logFileName string, maxNum uint, rotationTime time.Duration)

new output file log

type LogWriter

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

LogWriter log writer interface

Jump to

Keyboard shortcuts

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