logging

package
v2.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateLogger

func CreateLogger(name string) *logrus.Logger

CreateLogger creates a new logger with a name prefix

func SetFormatter added in v2.1.2

func SetFormatter(newFormatter logrus.Formatter)

SetFormatter sets the log formatter

func SetLevel

func SetLevel(newLevel logrus.Level)

SetLevel sets the log level to the given level

func SetOuput added in v2.0.12

func SetOuput(newOutput io.Writer)

SetOutput sets the log level to the given level

Types

type LogNameHook

type LogNameHook struct {
	// contains filtered or unexported fields
}

LogNameHook is a logrus hook to a

func NewNameHook

func NewNameHook(name string) *LogNameHook

NewNameHook creates a new hook to add name to entry fields

func (*LogNameHook) Fire

func (h *LogNameHook) Fire(entry *logrus.Entry) error

Fire is triggered on log entry

func (*LogNameHook) Levels

func (h *LogNameHook) Levels() []logrus.Level

Levels specifies the levels of the hook

Jump to

Keyboard shortcuts

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