logger

package
v0.0.0-...-1215978 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 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 CallerHook

type CallerHook struct{}

func (*CallerHook) Fire

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

func (*CallerHook) Levels

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

type Entry

type Entry interface {
	WithField(key string, value interface{}) Entry

	// WithString does the same thing as WithField, but is more efficient for
	// disabled log levels. (Because the value parameter doesn't escape.)
	WithString(key, value string) Entry

	WithFields(fields map[string]interface{}) Entry
	Logf(f string, args ...interface{})
}

type Logger

type Logger interface {
	Debug() Entry
	Info() Entry
	Error() Entry
	Fatal() Entry
	Panic() Entry
	Warn() Entry
	// SetLevel sets the logging level (debug, info, warn, error)
	SetLevel(level string) error

	Init() *logrus.Logger
}

func GetLoggerImplementation

func GetLoggerImplementation(format, output, filename string, maxSize, maxBackup int, compress bool) Logger

type LogrusEntry

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

func (*LogrusEntry) Logf

func (l *LogrusEntry) Logf(f string, args ...interface{})

func (*LogrusEntry) WithField

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

func (*LogrusEntry) WithFields

func (l *LogrusEntry) WithFields(fields map[string]interface{}) Entry

func (*LogrusEntry) WithString

func (l *LogrusEntry) WithString(key, value string) Entry

type LogrusLogger

type LogrusLogger struct {
	LogFormatter string
	LogOutput    string
	File         struct {
		FileName   string
		MaxSize    int
		MaxBackups int
		Compress   bool
	}
	// contains filtered or unexported fields
}

LogrusLogger is a Logger implementation that sends all logs to stdout using the Logrus package to get nice formatting

func (*LogrusLogger) Debug

func (l *LogrusLogger) Debug() Entry

func (*LogrusLogger) Error

func (l *LogrusLogger) Error() Entry

func (*LogrusLogger) Fatal

func (l *LogrusLogger) Fatal() Entry

func (*LogrusLogger) Info

func (l *LogrusLogger) Info() Entry

func (*LogrusLogger) Init

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

func (*LogrusLogger) Panic

func (l *LogrusLogger) Panic() Entry

func (*LogrusLogger) SetLevel

func (l *LogrusLogger) SetLevel(level string) error

func (*LogrusLogger) Start

func (l *LogrusLogger) Start() error

func (*LogrusLogger) Trace

func (l *LogrusLogger) Trace() Entry

func (*LogrusLogger) Warn

func (l *LogrusLogger) Warn() Entry

type NullLogger

type NullLogger struct {
	Logger
}

func (*NullLogger) Debug

func (n *NullLogger) Debug() Entry

func (*NullLogger) Error

func (n *NullLogger) Error() Entry

func (*NullLogger) Fatal

func (n *NullLogger) Fatal() Entry

func (*NullLogger) Info

func (n *NullLogger) Info() Entry

func (*NullLogger) Init

func (n *NullLogger) Init() *logrus.Logger

func (*NullLogger) Panic

func (n *NullLogger) Panic() Entry

func (*NullLogger) SetLevel

func (n *NullLogger) SetLevel(string) error

func (*NullLogger) Warn

func (n *NullLogger) Warn() Entry

type NullLoggerEntry

type NullLoggerEntry struct{}

func (*NullLoggerEntry) Logf

func (n *NullLoggerEntry) Logf(string, ...interface{})

func (*NullLoggerEntry) WithField

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

func (*NullLoggerEntry) WithFields

func (n *NullLoggerEntry) WithFields(fields map[string]interface{}) Entry

func (*NullLoggerEntry) WithString

func (n *NullLoggerEntry) WithString(key, value string) Entry

Jump to

Keyboard shortcuts

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