logger

package
v0.0.0-...-45904fa Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinLogger

func GinLogger() gin.HandlerFunc

GinLogger 接收gin框架默认的日志

func GinRecovery

func GinRecovery(stack bool) gin.HandlerFunc

GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志

func InitLogger

func InitLogger(config LoggerConfig) *zap.Logger

InitLogger 初始化日志库,支持日志增强和日志轮转

Types

type LoggerConfig

type LoggerConfig struct {
	EnvVar     string
	MaxSize    int
	MaxBackups int
	MaxAge     int
}

Jump to

Keyboard shortcuts

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