Documentation ¶
Index ¶
Constants ¶
View Source
const ( JsonFormat format = iota LogfmtFormat )
Format constants
Variables ¶
This section is empty.
Functions ¶
func NewWriterAdapter ¶ added in v0.6.3
func NewWriterAdapter(logger log.Logger, options ...WriterAdapterOption) io.Writer
NewWriterAdapter returns a new WriterAdapter wrapper around the passed logger.
func ParseFormat ¶
ParseFormat parses a string format name and returns the format or an error if the format is invalid.
Types ¶
type Config ¶
type Config struct { Output io.Writer Format format FallbackLevel level.Value Context []interface{} Debug bool }
Config holds a list of options used during the logger construction.
type WriterAdapter ¶ added in v0.6.3
WriterAdapter implements similar logic to StdlibAdapter in go-kit/log package, but instead of parsing incoming entries as standard go log entries WriterAdapter simply writes the whole entry as a log message.
type WriterAdapterOption ¶ added in v0.6.3
type WriterAdapterOption func(*WriterAdapter)
WriterAdapterOption sets a parameter for the WriterAdapter.
func MessageKey ¶ added in v0.6.3
func MessageKey(key string) WriterAdapterOption
MessageKey sets the key for the actual log message. By default, it's "msg".
Click to show internal directories.
Click to hide internal directories.