log

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultLogger = NewLogger()

DefaultLogger is logger with default settings

Functions

func AddHook

func AddHook(hook logrus.Hook)

AddHook adds hook to an instance of defaultLogger.

func Debug

func Debug(args ...interface{})

Debug logs a message at level Debug.

func DebugMode

func DebugMode() bool

DebugMode returns the state of debug mode

func Debugf

func Debugf(format string, args ...interface{})

Debugf logs a message at level Debug.

func Debugln

func Debugln(args ...interface{})

Debugln logs a message at level Debug.

func Error

func Error(args ...interface{})

Error logs a message at level Error.

func Errorf

func Errorf(format string, args ...interface{})

Errorf logs a message at level Error.

func Errorln

func Errorln(args ...interface{})

Errorln logs a message at level Error.

func Fatal

func Fatal(args ...interface{})

Fatal logs a message at level Fatal.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a message at level Fatal then the process will exit with status set to 1.

func Fatalln

func Fatalln(args ...interface{})

Fatalln logs a message at level Fatal then the process will exit with status set to 1.

func Info

func Info(args ...interface{})

Info logs a message at level Info.

func Infof

func Infof(format string, args ...interface{})

Infof logs a message at level Info.

func Infoln

func Infoln(args ...interface{})

Infoln logs a message at level Info.

func Panic

func Panic(args ...interface{})

Panic logs a message at level Panic.

func Panicf

func Panicf(format string, args ...interface{})

Panicf logs a message at level Panic.

func Panicln

func Panicln(args ...interface{})

Panicln logs a message at level Panic.

func Print

func Print(args ...interface{})

Print logs a message at level Info.

func Printf

func Printf(args ...interface{})

Printf logs a message at level Info.

func Println

func Println(args ...interface{})

Println logs a message at level Info.

func SetDebugMode

func SetDebugMode(isEnabled bool)

SetDebugMode sets the state of debug mode

func SetLevelName

func SetLevelName(name string) error

SetLevelName parses and sets the defaultLogger level.

func SetOutput

func SetOutput(output io.Writer)

SetOutput sets the defaultLogger output.

func Tracef

func Tracef(format string, args ...interface{})

Tracef logs a message at level Trace.

func Warn

func Warn(args ...interface{})

Warn logs a message at level Warn.

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a message at level Warn.

func Warnln

func Warnln(args ...interface{})

Warnln logs a message at level Warn.

Types

type Entry added in v0.0.4

type Entry struct {
	*logrus.Entry
}

Entry represents a wrapped logrus.Entry

func NewDefaultEntry added in v0.0.4

func NewDefaultEntry() *Entry

NewDefaultEntry returns a new Entry instance using default logger.

func NewEntry added in v0.0.4

func NewEntry(logger *Logger) *Entry

NewEntry returns a new Entry instance.

func WithContext

func WithContext(ctx context.Context) *Entry

WithContext adds an context to log entry, using the value defined inside of context.

func WithError

func WithError(err error) *Entry

WithError adds an error to log entry.

func WithField

func WithField(key string, value interface{}) *Entry

WithField adds a field to entry.

func WithFields

func WithFields(fields Fields) *Entry

WithFields adds multiple fields to entry.

func WithPrefix added in v0.0.4

func WithPrefix(value string) *Entry

WithPrefix adds a prefix to log entry.

func (*Entry) Debug added in v0.0.4

func (entry *Entry) Debug(args ...interface{})

Debug logs a message at level Debug.

func (*Entry) Debugf added in v0.0.4

func (entry *Entry) Debugf(format string, args ...interface{})

Debugf logs a message at level Debug.

func (*Entry) Debugln added in v0.0.4

func (entry *Entry) Debugln(args ...interface{})

Debugln logs a message at level Debug.

func (*Entry) Error added in v0.0.4

func (entry *Entry) Error(args ...interface{})

Error logs a message at level Error.

func (*Entry) Errorf added in v0.0.4

func (entry *Entry) Errorf(format string, args ...interface{})

Errorf logs a message at level Error.

func (*Entry) Errorln added in v0.0.4

func (entry *Entry) Errorln(args ...interface{})

Errorln logs a message at level Error.

func (*Entry) Fatal added in v0.0.4

func (entry *Entry) Fatal(args ...interface{})

Fatal logs a message at level Fatal.

func (*Entry) Fatalf added in v0.0.4

func (entry *Entry) Fatalf(format string, args ...interface{})

Fatalf logs a message at level Fatal.

func (*Entry) Fatalln added in v0.0.4

func (entry *Entry) Fatalln(args ...interface{})

Fatalln logs a message at level Fatal.

func (*Entry) Info added in v0.0.4

func (entry *Entry) Info(args ...interface{})

Info logs a message at level Info.

func (*Entry) Infof added in v0.0.4

func (entry *Entry) Infof(format string, args ...interface{})

Infof logs a message at level Info.

func (*Entry) Infoln added in v0.0.4

func (entry *Entry) Infoln(args ...interface{})

Infoln logs a message at level Info.

func (*Entry) Panic added in v0.0.4

func (entry *Entry) Panic(args ...interface{})

Panic logs a message at level Panic.

func (*Entry) Panicf added in v0.0.4

func (entry *Entry) Panicf(format string, args ...interface{})

Panicf logs a message at level Panic.

func (*Entry) Panicln added in v0.0.4

func (entry *Entry) Panicln(args ...interface{})

Panicln logs a message at level Panic.

func (*Entry) Print added in v0.0.4

func (entry *Entry) Print(args ...interface{})

Print logs a message at level Print.

func (*Entry) Printf added in v0.0.4

func (entry *Entry) Printf(format string, args ...interface{})

Printf logs a message at level Print.

func (*Entry) Println added in v0.0.4

func (entry *Entry) Println(args ...interface{})

Println logs a message at level Print.

func (*Entry) Trace added in v0.0.4

func (entry *Entry) Trace(args ...interface{})

Trace logs a message at level Trace.

func (*Entry) Tracef added in v0.0.4

func (entry *Entry) Tracef(format string, args ...interface{})

Tracef logs a message at level Trace.

func (*Entry) Traceln added in v0.0.4

func (entry *Entry) Traceln(args ...interface{})

Traceln logs a message at level Trace.

func (*Entry) Warn added in v0.0.4

func (entry *Entry) Warn(args ...interface{})

Warn logs a message at level Warn.

func (*Entry) Warnf added in v0.0.4

func (entry *Entry) Warnf(format string, args ...interface{})

Warnf logs a message at level Warn.

func (*Entry) Warnln added in v0.0.4

func (entry *Entry) Warnln(args ...interface{})

Warnln logs a message at level Warn.

func (*Entry) WithCaller added in v0.0.4

func (entry *Entry) WithCaller(skip int) *Entry

WithCaller adds caller field to the Entry.

func (*Entry) WithContext added in v0.0.4

func (entry *Entry) WithContext(ctx context.Context) *Entry

WithContext adds a context to the Entry.

func (*Entry) WithError added in v0.0.4

func (entry *Entry) WithError(err error) *Entry

WithError adds an field error to the Entry.

func (*Entry) WithField added in v0.0.4

func (entry *Entry) WithField(key string, value interface{}) *Entry

WithField adds a single field to the Entry.

func (*Entry) WithFields added in v0.0.4

func (entry *Entry) WithFields(fields Fields) *Entry

WithFields adds a map of fields to the Entry.

func (*Entry) WithPrefix added in v0.0.4

func (entry *Entry) WithPrefix(value string) *Entry

WithPrefix adds a prefix as single field (using the key `prefix`) to the Entry.

type Fields added in v0.0.4

type Fields logrus.Fields

Fields type, used to pass to `WithFields`.

type Logger

type Logger struct {
	*logrus.Logger
}

Logger represents a wrapped logrus.Logger

func NewLogger

func NewLogger() *Logger

NewLogger returns a new Logger instance with default values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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