Documentation
¶
Overview ¶
Package logrusutil implements some helpers for using logrus
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(formatter *DefaultFieldsFormatter)
Init set Logrus formatter if DefaultFieldsFormatter.wrappedFormatter is nil &logrus.JSONFormatter{} will be used instead
Types ¶
type CensoringFormatter ¶
type CensoringFormatter struct {
// contains filtered or unexported fields
}
CensoringFormatter represents a logrus formatter that can be used to censor sensitive information
func NewCensoringFormatter ¶
func NewCensoringFormatter(f logrus.Formatter, getSecrets func() sets.Set[string]) CensoringFormatter
NewCensoringFormatter generates a `CensoringFormatter` with a formatter as delegate and a set of strings to censor
func NewFormatterWithCensor ¶
func NewFormatterWithCensor(f logrus.Formatter, censorer secretutil.Censorer) CensoringFormatter
NewFormatterWithCensor generates a `CensoringFormatter` with a formatter as delegate and censorer to use
type DefaultFieldsFormatter ¶
type DefaultFieldsFormatter struct { WrappedFormatter logrus.Formatter DefaultFields logrus.Fields PrintLineNumber bool }
DefaultFieldsFormatter wraps another logrus.Formatter, injecting DefaultFields into each Format() call, existing fields are preserved if they have the same key