log

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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.

func WithContext

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

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

func WithError

func WithError(err error) *logrus.Entry

WithError adds an error to log entry.

func WithField

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

WithField adds a field to entry.

func WithFields

func WithFields(fields logrus.Fields) *logrus.Entry

WithFields adds multiple fields to entry.

func WithTime

func WithTime(t time.Time) *logrus.Entry

WithTime overrides the time of logs generated with it.

Types

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