logging

package
v0.0.0-...-43c3cf5 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PanicLevel = "panic"
	FatalLevel = "fatal"
	ErrorLevel = "error"
	WarnLevel  = "warn"
	InfoLevel  = "info"
	DebugLevel = "debug"
	TraceLevel = "trace"
)

const

View Source
const (
	//PANIC log level
	PANIC uint32 = iota
	//FATAL has list msg
	FATAL
	//ERROR has list msg
	ERROR
	//WARN only log
	WARN
	//INFO only log
	INFO
	//DEBUG only log
	DEBUG
	//TRACE only log
	TRACE
)
View Source
const (
	//MsgFormatSingle use info
	MsgFormatSingle uint32 = iota
	//MsgFormatMulti use show all func call relation
	MsgFormatMulti
)

Variables

This section is empty.

Functions

func CPrint

func CPrint(level uint32, msg string, formats ...LogFormat)

CPrint into stdout + log

func GetGID

func GetGID() uint64

GetGID return gid

func Init

func Init(path, filename string, level string, age uint32, disableCPrint bool)

Init loggers

func LoadFunctionHooker

func LoadFunctionHooker(logger *Logger)

LoadFunctionHooker loads a function hooker to the logger

func NewFileRotateHooker

func NewFileRotateHooker(path, filename string, age uint32, formatter logrus.Formatter) logrus.Hook

NewFileRotateHooker enable log file output

func VPrint

func VPrint(level uint32, msg string, formats ...LogFormat)

VPrint into log

Types

type LogFormat

type LogFormat = map[string]interface{}

LogFormat is to log format

type Logger

type Logger struct {
	*logrus.Logger
	//CallRelation to show stack list
	CallRelation uint32
}

func NewLogger

func NewLogger() *Logger

func (*Logger) SetCallRelation

func (logger *Logger) SetCallRelation(button uint32)

SetCallList to set CallList

Jump to

Keyboard shortcuts

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