logs

package
v0.0.0-...-07bccb4 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

Debugf logs a message at level Debug on the standard logger.

func Error

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

Errorf logs a message at level Error on the standard logger.

func Fatal

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

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

func Info

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

Infof logs a message at level Info on the standard logger.

func Panic

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

Panicf logs a message at level Panic on the standard logger.

func SetLevel

func SetLevel(logLevel string)

func SetRotateLogs

func SetRotateLogs(dir string)

func Trace

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

Tracef logs a message at level Trace on the standard logger.

func Warn

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

Warnf logs a message at level Warn on the standard logger.

func WithContext

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

WithContext creates an entry from the standard logger and adds a context to it.

func WithError

func WithError(err error) *logrus.Entry

WithError creates an entry from the standard logger and adds an error to it, using the value defined in ErrorKey as key.

func WithField

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

WithField creates an entry from the standard logger and adds a field to it. If you want multiple fields, use `WithFields`.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

func WithTime

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

WithTime creates an entry from the standard logger and overrides the time of logs generated with it.

Note that it doesn't log until you call Debug, Print, Info, Warn, Fatal or Panic on the Entry it returns.

Types

type Entry

type Entry struct {
	logrus.Entry
}

type Logger

type Logger struct {
	*logrus.Logger
}

Jump to

Keyboard shortcuts

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