logrushook

package module
v0.0.0-...-b2a8cf9 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

logrushook

The logrus hook implementation

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogType

type LogType string
const (
	Info  LogType = "info"
	Debug LogType = "debug"
	Error LogType = "error"
)

type LogrusHook

type LogrusHook struct {
	Dir string

	LevelTypeMap      map[logrus.Level]LogType
	LogFileNamePrefix string
	LogFileNameSuffix string
	LogFileExt        string
	Compress          bool
	FileCount         uint8
	CleanPeriod       time.Duration
	CleanEnable       bool
	// contains filtered or unexported fields
}

func New

func New(dir string, compress, cleanEnable bool) *LogrusHook

func (*LogrusHook) Fire

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

func (*LogrusHook) Levels

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

Jump to

Keyboard shortcuts

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