Documentation
¶
Index ¶
- Constants
- Variables
- func Crit(format string, v ...interface{})
- func Debug(format string, v ...interface{})
- func DisableColors()
- func Error(format string, v ...interface{})
- func GinLogger() gin.HandlerFunc
- func GinRecovery() gin.HandlerFunc
- func Info(format string, v ...interface{})
- func Notice(format string, v ...interface{})
- func SetLevel(l int)
- func SetOutput(w io.Writer)
- func Warn(format string, v ...interface{})
Constants ¶
View Source
const ( LevelCrit = iota // 0 - Critical errors (fatal, app should stop) LevelError // 1 - Errors (non-fatal but important) LevelWarn // 2 - Warnings LevelNotice // 3 - Important info (startup, shutdown, config) LevelInfo // 4 - General info LevelDebug // 5 - Debug details )
Log levels
Variables ¶
View Source
var ( // Logger is the package-level logger used across the project. Logger = log.New(os.Stdout, "", 0) // We'll handle our own formatting // Level controls verbosity. Default to NOTICE for sane production defaults. Level = LevelNotice UseColors = true // Enable colors by default TimeFormat = "Jan 02 15:04:05.000" // Kyle's format: "Oct 14 13:16:37.788" )
Functions ¶
func Crit ¶
func Crit(format string, v ...interface{})
Crit logs critical errors (application should stop)
func Debug ¶
func Debug(format string, v ...interface{})
Debug logs very verbose diagnostic messages
func Error ¶
func Error(format string, v ...interface{})
Error logs error-level messages (non-fatal but important)
func GinLogger ¶
func GinLogger() gin.HandlerFunc
GinLogger returns a gin.HandlerFunc middleware that logs requests using our logger
func GinRecovery ¶
func GinRecovery() gin.HandlerFunc
GinRecovery returns a gin.HandlerFunc middleware that recovers from panics
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.