logger

package
v0.1.8-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: GPL-3.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	SetToDebug()
	SetToInfo()
	Debug(msg string, keyValues ...interface{})
	Info(msg string, keyValues ...interface{})
	Error(msg string, keyValues ...interface{})
	Fatal(msg string, keyValues ...interface{})
	Warn(msg string, keyValues ...interface{})
}

Logger represents an interface for a logger

func NewLogrus

func NewLogrus() Logger

NewLogrus creates a logrus backed logger

func NewLogrusNoOp

func NewLogrusNoOp() Logger

NewLogrusNoOp creates a logrus backed logger that logs nothing

func NewLogrusWithFileRotation

func NewLogrusWithFileRotation(filePath string) Logger

NewLogrusWithFileRotation creates a logger with file backend and file rotation enabled. Two log file are created: - filePath.out stores DEBUG and INFO - filePath.err stores ERROR

type Logrus

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

Logrus implements Logger

func (*Logrus) Debug

func (l *Logrus) Debug(msg string, keyValues ...interface{})

Debug logs a message at level Debug on the standard logger

func (*Logrus) Error

func (l *Logrus) Error(msg string, keyValues ...interface{})

Error logs a message at level Error on the standard logger

func (*Logrus) Fatal

func (l *Logrus) Fatal(msg string, keyValues ...interface{})

Fatal logs a message at level Fatal on the standard logger

func (*Logrus) Info

func (l *Logrus) Info(msg string, keyValues ...interface{})

Info logs a message at level Info on the standard logger

func (*Logrus) SetToDebug

func (l *Logrus) SetToDebug()

SetToDebug sets the logger to DEBUG level

func (*Logrus) SetToInfo

func (l *Logrus) SetToInfo()

SetToInfo sets the logger to INFO level

func (*Logrus) Warn

func (l *Logrus) Warn(msg string, keyValues ...interface{})

Warn logs a message at level Warn on the standard logger

Jump to

Keyboard shortcuts

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