Documentation ¶
Overview ¶
Package logger handles application logging
Index ¶
- Constants
- func ErrorfAsError(log logrus.FieldLogger, format string, args ...interface{}) error
- func Log(args ...interface{}) logrus.FieldLogger
- func NewElasticHook() logrus.Hook
- func Root() *logrus.Logger
- func SanitizedURLString(urlWithCreds string) string
- func SetFormat(format string)
- func SetLevel(level string)
Constants ¶
View Source
const ( // TraceLevel represents the TRACE logging level TraceLevel = "trace" // DebugLevel represents the DEBUG logging level DebugLevel = "debug" // InfoLevel represents the INFO logging level InfoLevel = "info" // WarnLevel represents the WARN logging level WarnLevel = "warn" // ErrorLevel represents the ERROR logging level ErrorLevel = "error" // FatalLevel represents the FATAL logging level FatalLevel = "fatal" // PanicLevel represents the PANIC logging level PanicLevel = "panic" // JSONFormat represents the JSON logging format JSONFormat = "json" // TextFormat represents the text logging format TextFormat = "text" // ECSFormat represents the Elasticstack Common Schema (ECS) JSON logging format ECSFormat = "elastic" )
Variables ¶
This section is empty.
Functions ¶
func ErrorfAsError ¶
func ErrorfAsError(log logrus.FieldLogger, format string, args ...interface{}) error
ErrorfAsError logs an Error message to the supplied logger and then returns a new error object initialized with the message. The message is formatted with fmt.Sprintf() before passing to the logger and the error object.
func Log ¶
func Log(args ...interface{}) logrus.FieldLogger
Log returns a logrus FieldLogger including the root fields and an optional context
func NewElasticHook ¶
func SanitizedURLString ¶
SanitizedURLString returns a parsed URL string with user credentials removed
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.