log

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LevelNames

func LevelNames() string

LevelNames returns a comma separated list of available levels.

func SetupGlobalLogger

func SetupGlobalLogger(level string) error

SetupGlobalLogger uses to provided log level string and applies it globally.

func ToFile

func ToFile(fileName string) error

ToFile adds a file destination to the global logger.

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 StepLogger

type StepLogger struct {
	*logrus.Logger
	// contains filtered or unexported fields
}

StepLogger is a step counting logger implementation.

func NewStepLogger

func NewStepLogger(steps uint) *StepLogger

NewStepLogger creates a new logger

func (*StepLogger) WithStep

func (l *StepLogger) WithStep() *logrus.Entry

WithStep increments the internal step counter and adds the output to the field.

Jump to

Keyboard shortcuts

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