Documentation ¶
Index ¶
Constants ¶
View Source
const ( FormatText = "text" FormatJSON = "json" )
Log Format values.
View Source
const ( LevelTrace = "trace" LevelDebug = "debug" LevelInfo = "info" LevelWarn = "warn" LevelError = "error" )
Log Level values.
View Source
const ( FieldRemoteIP = "remote_ip" FieldMethod = "method" FieldPath = "path" FieldPathRaw = "path_raw" FieldStatusCode = "status_code" )
Field names.
Variables ¶
This section is empty.
Functions ¶
func ConfigureLogger ¶ added in v4.38.0
ConfigureLogger configures the default loggers level, formatting, and the output destinations.
func FormatFilePath ¶ added in v4.38.0
FormatFilePath formats a file path with the given time.
func InitializeLogger ¶
InitializeLogger configures the default logger similar to ConfigureLogger but also configures the stack levels hook.
Types ¶
type CtxPrintfLogger ¶ added in v4.36.8
type CtxPrintfLogger struct {
// contains filtered or unexported fields
}
CtxPrintfLogger is a logger that implements a common Printf logger with a ctx.
func LoggerCtxPrintf ¶ added in v4.36.8
func LoggerCtxPrintf(level logrus.Level) (logger *CtxPrintfLogger)
LoggerCtxPrintf returns a new CtxPrintfLogger given a level.
type PrintfLogger ¶ added in v4.36.8
type PrintfLogger struct {
// contains filtered or unexported fields
}
PrintfLogger is a logger that implements a common Printf logger.
func LoggerPrintf ¶ added in v4.36.8
func LoggerPrintf(level logrus.Level) (logger *PrintfLogger)
LoggerPrintf returns a new PrintfLogger given a level.
func (*PrintfLogger) Printf ¶ added in v4.36.8
func (l *PrintfLogger) Printf(format string, args ...any)
Printf is the implementation of the interface.
Click to show internal directories.
Click to hide internal directories.