logger

package
v0.0.0-...-2b22c89 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindCaller

func FindCaller() string

func Init

func Init(cfg *Config) error

func NewHook

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

NewHook builds a new rotate file hook.

Types

type Config

type Config struct {
	AppName    string `mapstructure:"app"`
	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"`
	ShowFile   bool   `mapstructure:"show-file"`
}

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