logger

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(config Config) error

Setup sets up the application logger globally.

Types

type Config

type Config struct {
	// level defines minimum log level that needs to be logged.
	Level string
	// Discard defines if the logs should be discarded or not. Often dedicated
	// to test environment.
	Discard bool
	// DefaultFields defines the list of static default key-value pair that
	// should appear in the logs.
	DefaultFields map[string]interface{}
	// ContextFields defines the list of dynamic context key-value pair that
	// should appear in the logs.
	ContextFields map[string]interface{}
}

Config holds configuration parameters.

func (Config) Fire

func (c Config) Fire(e *logrus.Entry) error

Fire runs on each logging call in order to add static and dynamic key-value pair to logs.

func (Config) Levels

func (c Config) Levels() []logrus.Level

Levels allows all log levels to include all key-value pair.

Jump to

Keyboard shortcuts

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