Documentation
¶
Index ¶
Constants ¶
View Source
const Prefix contextKey = "prefix"
Prefix is the context key for the log prefix.
Variables ¶
This section is empty.
Functions ¶
func ContextWithPrefix ¶
ContextWithPrefix creates a context.Context which has given prefix as value.
Types ¶
type ContextPrefixFormatter ¶
type ContextPrefixFormatter struct {
*logrus.TextFormatter
}
ContextPrefixFormatter prefixes log messages based on the entry context.
func (*ContextPrefixFormatter) Format ¶
func (f *ContextPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error)
Format implements logrus.Formatter. Will prepend the message of entry with a prefix present in the log context if exists. For all other formatting the default logrus.TextFormatter is used.
type LineWriter ¶
type LineWriter func(args ...interface{})
LineWriter is a printf-style func which satisfies the io.Writer interface.
Click to show internal directories.
Click to hide internal directories.