log

package
Version: v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogFolder the default folder to write logs
	LogFolder = filepath.Join(common.GetTempFolder(), "log")
)

Functions

This section is empty.

Types

type Auditor

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

Auditor is used for auditing step by step via log.

func NewAuditor

func NewAuditor(log *SeeleLog) *Auditor

NewAuditor returns a new auditor instance with specified log and an optional last time.

func (*Auditor) Audit

func (a *Auditor) Audit(format string, args ...interface{})

Audit adds log for the specified parameterized message.

func (*Auditor) AuditEnter

func (a *Auditor) AuditEnter(method string)

AuditEnter adds log for method enter.

func (*Auditor) AuditLeave

func (a *Auditor) AuditLeave()

AuditLeave adds log for method leave.

type CallerHook

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

CallerHook a caller hook of logrus

func (*CallerHook) Fire

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

Fire adds a caller field in logger instance

func (*CallerHook) Levels

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

Levels returns supported levels

type SeeleLog

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

SeeleLog wraps log class

func GetLogger

func GetLogger(module string) *SeeleLog

GetLogger gets logrus.Logger object according to module name each module can have its own logger

func (*SeeleLog) Debug

func (p *SeeleLog) Debug(format string, args ...interface{})

Debug Level. Usually only enabled when debugging. Very verbose logging.

func (*SeeleLog) Error

func (p *SeeleLog) Error(format string, args ...interface{})

Error Level. Error logs and is used for errors that should be definitely noted. Commonly used for hooks to send errors to an error tracking service.

func (*SeeleLog) Fatal

func (p *SeeleLog) Fatal(format string, args ...interface{})

Fatal Level. Fatal logs and then calls `os.Exit(1)`. It will exit even if the logging level is set to Panic.

func (*SeeleLog) GetLevel

func (p *SeeleLog) GetLevel() logrus.Level

GetLevel get the log level

func (*SeeleLog) Info

func (p *SeeleLog) Info(format string, args ...interface{})

Info Level. General operational entries about what's going on inside the application.

func (*SeeleLog) Panic

func (p *SeeleLog) Panic(format string, args ...interface{})

Panic Level, highest level of severity. Panic logs and then calls panic with the message passed to Debug, Info, ...

func (*SeeleLog) SetLevel

func (p *SeeleLog) SetLevel(level logrus.Level)

SetLevel set the log level

func (*SeeleLog) Warn

func (p *SeeleLog) Warn(format string, args ...interface{})

Warn Level. Non-critical entries that deserve eyes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL