log

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PanicLevel = logrus.PanicLevel
	FatalLevel = logrus.FatalLevel
	ErrorLevel = logrus.ErrorLevel
	WarnLevel  = logrus.WarnLevel
	InfoLevel  = logrus.InfoLevel
	DebugLevel = logrus.DebugLevel
	TraceLevel = logrus.TraceLevel
)

Variables

Functions

func Debug

func Debug(v ...interface{})

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

func Debugf

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

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

func Debugln

func Debugln(v ...interface{})

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

func Display

func Display(v ...interface{})

func Error

func Error(v ...interface{})

Error loggs a message at level Error on the standard logger.

func Errorf

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

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

func Errorln

func Errorln(v ...interface{})

Errorln loggs a message at level Error on the standard logger.

func Fatal

func Fatal(v ...interface{})

Fatal loggs a message at level Fatal on the standard logger.

func Fatalf

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

Fatalf loggs a message at level Fatal on the standard logger.

func Fatalln

func Fatalln(v ...interface{})

Fatalln loggs a message at level Fatal on the standard logger.

func Hook

func Hook(hook logrus.Hook)

Hook adds a logging hook to the logger instance

func Info

func Info(v ...interface{})

Info loggs a message at level Info on the standard logger.

func Infof

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

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

func Infoln

func Infoln(v ...interface{})

Infoln loggs a message at level Info on the standard logger.

func Instance

func Instance() *logrus.Logger

Instance returns the underlying logger instance

func IsDebug

func IsDebug() bool

IsDebug returns whether debug level logs are enabled

func IsError

func IsError() bool

IsError returns whether error level logs are enabled

func IsFatal

func IsFatal() bool

IsFatal returns whether fatal level logs are enabled

func IsInfo

func IsInfo() bool

IsInfo returns whether info level logs are enabled

func IsPanic

func IsPanic() bool

IsPanic returns whether panic level logs are enabled

func IsTrace

func IsTrace() bool

IsTrace returns whether trace level logs are enabled

func IsWarn

func IsWarn() bool

IsWarn returns whether warning level logs are enabled

func Panic

func Panic(v ...interface{})

Panic loggs a message at level Panic on the standard logger.

func Panicf

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

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

func Panicln

func Panicln(v ...interface{})

Panicln loggs a message at level Panic on the standard logger.

func Print

func Print(v ...interface{})

Print loggs a message at level Print on the standard logger.

func Printf

func Printf(format string, v ...interface{})

Printf loggs a message at level Print on the standard logger.

func Println

func Println(v ...interface{})

Println loggs a message at level Print on the standard logger.

func SetFormat

func SetFormat(v string)

SetFormat sets the logging format of the logger instance.

func SetLevel

func SetLevel(v string)

SetLevel sets the logging level of the logger instance.

func SetOutput

func SetOutput(v string)

SetOutput sets the logging output of the logger instance.

func Warn

func Warn(v ...interface{})

Warn loggs a message at level Warn on the standard logger.

func Warnf

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

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

func Warnln

func Warnln(v ...interface{})

Warnln loggs a message at level Warn on the standard logger.

func WithField

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

WithField prepares a log entry with a single data field.

func WithFields

func WithFields(fields map[string]interface{}) *logrus.Entry

WithFields prepares a log entry with multiple data fields.

func WithPrefix

func WithPrefix(value interface{}) *logrus.Entry

WithPrefix prepares a log entry with a prefix.

Types

type DefaultHook

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

func (*DefaultHook) Fire

func (h *DefaultHook) Fire(entry *logrus.Entry) error

func (*DefaultHook) Levels

func (h *DefaultHook) Levels() []logrus.Level

func (*DefaultHook) SetFormat

func (h *DefaultHook) SetFormat(v string)

SetFormat sets the logging format of the logger instance.

func (*DefaultHook) SetLevel

func (h *DefaultHook) SetLevel(v string)

SetLevel sets the logging level of the logger instance.

func (*DefaultHook) SetOutput

func (h *DefaultHook) SetOutput(v string)

SetOutput sets the logging output of the logger instance.

type JSONFormatter

type JSONFormatter struct {
	IgnoreFields    []string
	TimestampFormat string
}

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(entry *logrus.Entry) (data []byte, err error)

type Logger

type Logger struct {
	*logrus.Logger
}

Logger ...

type StackdriverLogger

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

func NewStackDriver

func NewStackDriver() *StackdriverLogger

func (*StackdriverLogger) Fire

func (h *StackdriverLogger) Fire(entry *logrus.Entry) error

func (*StackdriverLogger) Levels

func (h *StackdriverLogger) Levels() []logrus.Level

type TextFormatter

type TextFormatter struct {
	IgnoreFields    []string
	TimestampFormat string
}

func (*TextFormatter) Format

func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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