Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Format ¶ added in v0.3.2
type Format string
Log format enum.
func ParseFormat ¶ added in v0.3.2
type Option ¶ added in v0.3.2
type Option func(*Options)
func WithFields ¶ added in v0.3.2
WithFields set default fields for the logger
func WithFormat ¶ added in v0.3.2
WithFormat set default log format for the logger
func WithOutput ¶ added in v0.3.2
WithOutput set default output writer for the logger
func WithTimeFormat ¶ added in v0.3.2
WithTimeFormat set default timeFormat for the logger
type Options ¶ added in v0.3.2
type Options struct { // The logging level the logger should log at. default is `InfoLevel` Level zerolog.Level // Log format. default `json` Format Format // TimeFormat is one of time.RFC3339, time.RFC3339Nano, time.* TimeFormat string // Flag for whether to log caller info (off by default) ReportCaller bool // fields to always be logged Fields map[string]interface{} // It's common to set this to a file, or leave it default which is `os.Stderr` Out io.Writer // Alternative options Context context.Context }
Click to show internal directories.
Click to hide internal directories.