logging

package
Version: v4.14.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Set

func Set(configuration *Configuration)

Set configures the logger with the given configuration.

Types

type Configuration

type Configuration struct {
	// Output location of the logger.
	// Can be either a path relative to the configuration directory, STDOUT or STDERR.
	Output string `json:"output"`

	// Level from which on the entries are logged.
	Level logrus.Level `json:"level"`
}

Configuration serializes and deserializes the logging parameters.

func (Configuration) MarshalJSON

func (configuration Configuration) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Configuration) UnmarshalJSON

func (configuration *Configuration) UnmarshalJSON(bytes []byte) error

UnmarshalJSON implements json.Unmarshaler.

type Logger

type Logger struct {
	logrus.Logger
}

Logger adds a method to the logrus logger.

func Get

func Get() *Logger

Get returns the configured logger or a new one based on the configuration file.

func NewLogger

func NewLogger(configuration *Configuration) *Logger

NewLogger returns a new logger based on the given configuration.

func (*Logger) WithGroup

func (logger *Logger) WithGroup(group string) *logrus.Entry

WithGroup sets a trace group for the log entry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL