Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LoggerFactory ¶
type LoggerFactory interface {
NewNamedLogger(name string) zerolog.Logger
Level() zerolog.Level
IsStructuredLogging() bool
}
LoggerFactory is a factory that can be used to create named loggers using the same aligned configuration and namespace.
func New ¶
func New(structuredLogging, unixTimeStamp, disableColoredLogs bool, options ...Option) LoggerFactory
New creates a new LoggerFactory which then can be used to create configured named loggers (log channels)
Example ¶
// create the factory
loggingFactory := New(true, false, false)
// create new named logger
logger := loggingFactory.NewNamedLogger("MyLogger")
logger.Info().Msg("Hello World")
Click to show internal directories.
Click to hide internal directories.