Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error string
Error represents package level error related to logging work.
const ( // ErrParseLevel indicates that string given to function ParseLevel can't be parsed to Level. ErrParseLevel Error = "string can't be parsed as Level, use: `error`, `warn`, `info`, `debug`" )
type Option ¶
type Option func(*Options)
Option represents a function that modifies the configuration options for the logging library.
func WithColor ¶ added in v0.2.2
func WithColor() Option
WithColor creates an Option that enables color formatting for log messages. Will not take effect ff WithJSON is applied.
func WithJSON ¶
func WithJSON() Option
WithJSON creates an Option that enables JSON formatting for log messages. When this Option is applied, log messages will be formatted as JSON objects.
func WithSource ¶ added in v0.2.2
func WithSource() Option
WithSource creates an Option that enables source code line number formatting for log messages. When this Option is applied, log messages will contain source code line number.
func WithTimeFormat ¶ added in v0.2.2
WithTimeFormat creates an Option that change the time formatting for log messages.
func WithWriter ¶
WithWriter changes the writer for each leveled loggers of StdLog to the given on.