log

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RootLoggerName - Root logger name, contains all log data
	RootLoggerName = "root"
	// RootLogger - Root Logger
	RootLogger = rootLogger()
)
View Source
var (
	// AuditLogger - Single audit log
	AuditLogger = newAuditLogger()
)

Functions

func GetLogDir

func GetLogDir() string

GetLogDir - Return the log dir

func GetRootAppDir

func GetRootAppDir() string

GetRootAppDir - Get the Sliver app dir, default is: ~/.sliver/

func LevelFrom

func LevelFrom(level int) logrus.Level

LevelFrom - returns level from int

func NamedLogger

func NamedLogger(pkg, stream string) *logrus.Entry

NamedLogger - Returns a logger wrapped with pkg/stream fields

Types

type StdoutHook

type StdoutHook struct {
	Name string
	// contains filtered or unexported fields
}

TxtHook - Hook in a textual version of the logs

func NewStdoutHook

func NewStdoutHook(name string) *StdoutHook

NewTxtHook - returns a new txt hook

func (*StdoutHook) Fire

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

Fire - Implements the fire method of the Logrus hook

func (*StdoutHook) Levels

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

Levels - Hook all levels

type TxtHook

type TxtHook struct {
	Name string
	// contains filtered or unexported fields
}

TxtHook - Hook in a textual version of the logs

func NewTxtHook

func NewTxtHook(name string) *TxtHook

NewTxtHook - returns a new txt hook

func (*TxtHook) Fire

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

Fire - Implements the fire method of the Logrus hook

func (*TxtHook) Levels

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

Levels - Hook all levels

Jump to

Keyboard shortcuts

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