v1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger Represents loggo logger and fields to support structured logging.

func New

func New() *Logger

New Initiate logger.

func (*Logger) AutoClearFields

func (l *Logger) AutoClearFields(enabled bool)

AutoClearFields if true , Will clear any field that is set using WithField(s) call after a log line is logged/printed.

func (*Logger) ClearFields

func (l *Logger) ClearFields()

ClearFields Reset all fields set by WithField(s) method.

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, args ...interface{})

Debugf Log at debug level.

func (*Logger) Errorf

func (l *Logger) Errorf(msg string, args ...interface{})

Errorf Log at error level.

func (*Logger) Fatalf

func (l *Logger) Fatalf(msg string, args ...interface{})

Fatalf Log at fatal level.

func (*Logger) Infof

func (l *Logger) Infof(msg string, args ...interface{})

Infof Log at info level.

func (*Logger) LogLevel

func (l *Logger) LogLevel() string

LogLevel Current log level

func (*Logger) Logf

func (l *Logger) Logf(level logrus.Level, msg string, args ...interface{})

Logf Log at given log level.

func (*Logger) Logger

func (l *Logger) Logger() *logrus.Logger

Logger Change output. Default output is os.Stderr.

func (*Logger) Panicf

func (l *Logger) Panicf(msg string, args ...interface{})

Panicf Log at panic level.

func (*Logger) SetLevel

func (l *Logger) SetLevel(levelStr string)

SetLevel Set log level

func (*Logger) SetOutput

func (l *Logger) SetOutput(w io.Writer)

SetOutput Change output. Default output is os.Stderr.

func (*Logger) Tracef

func (l *Logger) Tracef(msg string, args ...interface{})

Tracef Log at trace level.

func (*Logger) Warningf

func (l *Logger) Warningf(msg string, args ...interface{})

Warningf Log at warning level.

func (*Logger) WithError

func (l *Logger) WithError(err error) pkg.Logger

WithError Log the given error as a seperate field.

func (*Logger) WithField

func (l *Logger) WithField(k string, v interface{}) pkg.Logger

WithField Add given key, value as custom field and value in log.

func (*Logger) WithFields

func (l *Logger) WithFields(kv map[string]interface{}) pkg.Logger

WithFields Add given key, value pairs as custom fields and values in log.

Jump to

Keyboard shortcuts

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