log

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize() error

Initialize initializes the global Logrus logger, reading the desired log level from the viper store, or using a default if the level has not been set in viper.

It also sets the output to log.SplitErrOutputs(...) so you get error logs on stderr and normal logs on stdout.

If syslog settings are also in viper, then Syslog will be initialized as well.

Types

type OutputSplitFunc added in v0.3.3

type OutputSplitFunc func(lvl []byte) io.Writer

OutputSplitFunc implements the io.Writer interface for use with Logrus, and simply splits logs between stdout and stderr depending on their severity.

func SplitErrOutputs added in v0.3.3

func SplitErrOutputs(out, err io.Writer) OutputSplitFunc

SplitErrOutputs returns an OutputSplitFunc that splits output to either one of two given outputs depending on whether the level is "error","fatal","panic".

func (OutputSplitFunc) Write added in v0.3.3

func (fn OutputSplitFunc) Write(b []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL