# README
logrus
Using logrus instance to build a logger.Logger
// there are few ways to build a logrus instance
// using the logger configuration
var log, err = logrus.New(
logrus.WithConfig(cfg logger.Config),
)
// building it directly
var log, err = logrus.New(
logrus.WithLevel(level logger.Level),
logrus.WithConsoleFormatter(colored bool),
logrus.WithJSONFormatter(),
logrus.WithOutput(writer io.Writer),
)
// or by giving an already built logrus instance
var log, err = logrus.New(
logrus.WithInstance(log *logrus.Logger),
)
Once the logger has been built, it can be used like any other logger.Logger.
# Functions
New returns a new logrus instance.
WithConfig takes the logger configuration and applies it.
WithConsoleFormatter configures the format of the log output to use "console" (cli) formatter.
WithInstance set logrus logger instance.
WithJSONFormatter configures the format of the log output to use "json" formatter.
WithLevel configures the minimum level of the logger.
WithOutput configures the writer used to write logs to.
WithoutTime configures the logger to log without time.
# Type aliases
Option defines a function signature to update configuration.