logger

package
v0.0.0-...-ff33c78 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(c Config) error

func NewHook

func NewHook(app string, c Config, level logrus.Level) (logrus.Hook, error)

NewHook builds a new rotate file hook.

Types

type Config

type Config struct {
	Level      string `mapstructure:"level"`
	MaxSize    int    `mapstructure:"max-size"`
	MaxAge     int    `mapstructure:"max-age"`
	MaxBackups int    `mapstructure:"max-backup"`
	Output     string `mapstructure:"output"`
	Stdout     bool   `mapstructure:"stdout"`
}

type File

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

File represents the rotate file hook.

func (*File) Fire

func (hook *File) Fire(entry *logrus.Entry) (err error)

Fire is called by logrus when it is about to write the log entry.

func (*File) Levels

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

Levels determines log levels that for which the logs are written.

Jump to

Keyboard shortcuts

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