logging

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccessDebug

func AccessDebug(ctx *gin.Context, args ...any)

func AccessDebugf

func AccessDebugf(ctx *gin.Context, format string, args ...any)

func AccessLogf

func AccessLogf(format string, args ...any)

访问日志

默认日志级别为 Info

func AccessWarning

func AccessWarning(ctx *gin.Context, args ...any)

func AccessWarningf

func AccessWarningf(ctx *gin.Context, format string, args ...any)

func Debug

func Debug(args ...any)

服务日志

Debug 级别日志

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(args ...any)

服务日志

Error 级别日志

func Errorf

func Errorf(format string, args ...any)

func Info

func Info(args ...any)

服务日志

Info 级别日志

func Infof

func Infof(format string, args ...any)

func Init

func Init()

func SetLevel

func SetLevel(level logrus.Level)

服务日志

设置日志级别

func Warning

func Warning(args ...any)

服务日志

Warning 级别日志

func Warningf

func Warningf(format string, args ...any)

Types

type LoggerAccessFormatter

type LoggerAccessFormatter struct{}

func (*LoggerAccessFormatter) Format

func (l *LoggerAccessFormatter) Format(entry *logrus.Entry) ([]byte, error)

实现Format方法

type LoggerFileHook

type LoggerFileHook struct {
	// contains filtered or unexported fields
}

func NewLoggerFileHook

func NewLoggerFileHook(isService bool) *LoggerFileHook

func (*LoggerFileHook) Fire

func (h *LoggerFileHook) Fire(entry *logrus.Entry) error

HOOK

将日志写入文件

func (*LoggerFileHook) Levels

func (h *LoggerFileHook) Levels() []logrus.Level

type LoggerServiceFormatter

type LoggerServiceFormatter struct{}

func (*LoggerServiceFormatter) Format

func (l *LoggerServiceFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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