stdout

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	// The io.Writer, this can be stdout or stderr.
	Writer io.Writer
	// The slice of log levels the writer can too.
	LogLevels []logrus.Level
}

Hook is a hook that writes logs of specified LogLevels to specified Writer.

func (*Hook) Fire

func (hook *Hook) Fire(entry *logrus.Entry) error

Fire will be called when some logging function is called with current hook. It will format log entry to string and write it to appropriate writer

func (*Hook) Levels

func (hook *Hook) Levels() []logrus.Level

Levels Define on which log levels this hook would trigger.

Jump to

Keyboard shortcuts

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