logging

package
v0.0.0-...-7ef1397 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const RuntimeLogChanMax = 100

Variables

View Source
var (
	//RuntimeLog 系统运行时日志,记录发生的异常和错误
	RuntimeLog = logrus.New()
	// CLILog 控制台日志
	CLILog = logrus.New()
	// RuntimeLogChan 系统运行日志的chan,用于将日志通过chan的方式发送到其它地方
	RuntimeLogChan chan []byte
)

Functions

func GetCustomLoggerFormatter

func GetCustomLoggerFormatter() logrus.Formatter

GetCustomLoggerFormatter 日定义日志格式

Types

type RuntimeLogHook

type RuntimeLogHook struct {
	Writer    io.Writer
	LogLevels []logrus.Level
}

func (*RuntimeLogHook) Fire

func (hook *RuntimeLogHook) Fire(entry *logrus.Entry) error

func (*RuntimeLogHook) Levels

func (hook *RuntimeLogHook) Levels() []logrus.Level

Levels define on which log levels this hook would trigger

type RuntimeLogMessage

type RuntimeLogMessage struct {
	Source  string `json:"source"`
	File    string `json:"file"`
	Func    string `json:"func"`
	Level   string `json:"level"`
	Message string `json:"msg"`
}

type RuntimeLogWriter

type RuntimeLogWriter struct {
}

func (RuntimeLogWriter) Write

func (w RuntimeLogWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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