Documentation
¶
Index ¶
- func NewLogger(opts ...logger.Option) logger.Logger
- func WithColor(useColor bool) logger.Option
- func WithExitFunc(exit func(int)) logger.Option
- func WithHooks(hooks []zerolog.Hook) logger.Option
- func WithLevel(lvl logger.Level) logger.Option
- func WithLevelFieldName(levelFieldName string) logger.Option
- func WithOut(out io.Writer) logger.Option
- func WithPretty(pretty bool) logger.Option
- func WithReportCaller(reportCaller bool) logger.Option
- func WithTimeFieldFormat(formatter zerolog.Formatter) logger.Option
- func ZerologToLoggerLevel(level zerolog.Level) logger.Level
- type Options
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithExitFunc ¶
func WithLevelFieldName ¶
func WithOut ¶
Example ¶
l := NewLogger(WithOut(os.Stdout), WithLevel(logger.DebugLevel)) l.Logf(logger.InfoLevel, "testing: %s", "logf")
Output: {"level":"info","message":"testing: logf"}
func WithPretty ¶
func WithReportCaller ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.