cashuLog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(logLevel string)

func NewRotateFileHook

func NewRotateFileHook(config RotateFileConfig) (log.Hook, error)

func ToJson

func ToJson(i interface{}) string

func ToMap

func ToMap(i interface{}) map[string]interface{}

func WithLoggable

func WithLoggable(l Loggable, more ...interface{}) log.Fields

Types

type Loggable

type Loggable interface {
	Log() map[string]interface{}
}

type RotateFileConfig

type RotateFileConfig struct {
	Filename   string
	MaxSize    int
	MaxBackups int
	MaxAge     int
	Compress   bool
	Level      log.Level
	Formatter  log.Formatter
}

RotateFileConfig configuration for logfile rotation.

type RotateFileHook

type RotateFileHook struct {
	Config RotateFileConfig
	// contains filtered or unexported fields
}

RotateFileHook is file rotation hook for logrus

func (*RotateFileHook) Fire

func (hook *RotateFileHook) Fire(entry *log.Entry) (err error)

func (*RotateFileHook) Levels

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

Jump to

Keyboard shortcuts

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