Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // UserCurrentFunc is a variable that holds the function to get the current user. // It's exported for testing purposes to allow mocking. UserCurrentFunc = user.Current )
Functions ¶
func GetDefaultOpts ¶ added in v0.8.0
GetDefaultOpts returns a copy of the default logger options. This is useful for tests that need to modify options for a specific logger instance.
func GetLogger ¶
GetLogger returns the singleton instance of the logger. If filePath is provided (typically by InitFileLogger), it attempts to set up file logging. Otherwise, or if file opening fails, it defaults to stdout. The 'level' and 'filePath' parameters are only effective on the first call that initializes the logger.
func InitFileLogger ¶ added in v0.8.0
InitFileLogger sets up the global logger with file output. It ensures the log directory exists and creates a timestamped log file.
func LoggingMiddleware ¶ added in v0.8.0
func LoggingMiddleware(log *logf.Logger) gin.HandlerFunc
LoggingMiddleware returns a Gin middleware that logs all HTTP requests with details.
Types ¶
This section is empty.