log

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormatterHook

type FormatterHook struct {
	Writer        io.Writer
	LogLevels     []log.Level
	Formatter     log.Formatter
	DefaultFields log.Fields
}

FormatterHook is a hook that writes logs of specified LogLevels with a formatter to specified Writer

func (*FormatterHook) Fire

func (hook *FormatterHook) Fire(entry *log.Entry) error

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

func (*FormatterHook) Levels

func (hook *FormatterHook) Levels() []log.Level

Levels define on which log levels this hook would trigger

type NestedJSONFormatter

type NestedJSONFormatter struct {
	PrettyPrint       bool
	DisableHTMLEscape bool
}

func (*NestedJSONFormatter) Format

func (f *NestedJSONFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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