log

package
v1.30.36 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 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()

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

func Error

func Error(args ...interface{})

Error sugar

func Info

func Info(args ...interface{})

func Warn

func Warn(args ...interface{})

Types

type Log

type Log struct {
	*logrus.Logger
	LogWriter
}

Log log

func Logger

func Logger() *Log

Logger one single log

func NewLog

func NewLog() *Log

NewLog new log

func (*Log) ErrorLine

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

ErrorLine print error line

func (*Log) FileLog

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

FileLog 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