log

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTTP request tracing headers
	HeaderRequestID = "X-Request-ID"
	HeaderTraceID   = "X-Trace-ID"
)

Variables

This section is empty.

Functions

func GetRequestID

func GetRequestID(c *gin.Context) string

GetRequestID retrieves the request ID from the gin.Context

func GetRequestLogger

func GetRequestLogger(c *gin.Context) *log.Logger

GetRequestLogger retrieves the logger from the gin.Context

func GetRequestTraceID

func GetRequestTraceID(c *gin.Context) string

GetRequestTraceID retrieves the trace ID from the gin.Context

func HTTPLogMiddleware

func HTTPLogMiddleware(logger *log.Logger) gin.HandlerFunc

HTTPLogMiddleware is a middleware for logging HTTP requests

func NewHTTPLogger

func NewHTTPLogger(moduleName string) *log.Logger

func RequestDebug

func RequestDebug(c *gin.Context, msg string, fields ...map[string]interface{})

RequestDebug logs a debug message for the current request

func RequestError

func RequestError(c *gin.Context, err error, msg string, fields ...map[string]interface{})

RequestError logs an error message for the current request

func RequestInfo

func RequestInfo(c *gin.Context, msg string, fields ...map[string]interface{})

RequestInfo logs an info message for the current request

func RequestWarn

func RequestWarn(c *gin.Context, msg string, fields ...map[string]interface{})

RequestWarn logs a warning message for the current request

Types

This section is empty.

Jump to

Keyboard shortcuts

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