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 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. This Option modifies the 'withJSON' field of the Options struct. Example: options := &Options{} opt := WithJSON() opt(options) After applying the WithJSON Option, options.withJSON field will be set to true.
func WithWriter ¶
WithWriter changes the writer for each leveled loggers of StdLog to the given on.
Click to show internal directories.
Click to hide internal directories.