log

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTracePath added in v0.2.3

func AddTracePath(l *logrus.Entry, newPathElement string) *logrus.Entry

AddTracePath adds a path element to the logrus entry's field 'trace'. This is meant to be done everytime you hand off a logger/entry to a different component to have a clear trace how we ended up here. When logs are emitted by this logger entry, the field might look something like:

trace=patch-announce.announcer.release-noter

func NullLogger added in v0.2.3

func NullLogger() *logrus.Entry

func SetupGlobalLogger added in v0.2.3

func SetupGlobalLogger(level string) error

Types

type FileNameHook

type FileNameHook struct {
	Formatter func(file, function string, line int) string
	// contains filtered or unexported fields
}

func NewFilenameHook

func NewFilenameHook() *FileNameHook

NewFilenameHook creates a new default FileNameHook

func (*FileNameHook) Fire

func (f *FileNameHook) Fire(entry *logrus.Entry) error

Fire executes the hook for every logrus entry

func (*FileNameHook) Levels

func (f *FileNameHook) Levels() []logrus.Level

Levels returns the levels for which the hook is activated. This contains currently only the DebugLevel

type Mixin added in v0.2.3

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

Logger can be embedded in other struct to enable logging and keep the zero-value of the struct useful. Examples of the usage can be found in k8s.io/release/pkg/patch/...

func (*Mixin) Logger added in v0.2.3

func (l *Mixin) Logger() *logrus.Entry

func (*Mixin) SetLogger added in v0.2.3

func (l *Mixin) SetLogger(logger *logrus.Entry, tracePaths ...string)

Jump to

Keyboard shortcuts

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