Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogForGin ¶
func LogForGin(logger *Logger) gin.HandlerFunc
LogForGin returns a gin.HandlerFunc (middleware) that logs requests using Logger.
Requests with errors are logged using log15.Error(). Requests without errors are logged using log15.Info().
func LogPanicData ¶
func LogPanicData(panicData interface{}) error
LogPanicData logs the panic data with stacktrace and return an error with the panic message. This function is separated from LogAndPanic so that unwanted panics can still be logged with this function.
Types ¶
type Logger ¶
A Logger writes logs to a handler
func NewLogger ¶
func NewLogger(ctx ...interface{}) *Logger
NewLogger returns a pointer to a new Logger instance
Click to show internal directories.
Click to hide internal directories.