logx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry interface {
	WithFields(fields Fields) Entry
	WithField(name string, value interface{}) Entry
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Entry describes the interface for the logger entry.

type Fields

type Fields map[string]interface{}

Fields type, used to pass to `WithFields`.

type Logger

type Logger interface {
	SubLogger(fields Fields) Logger
	WithFields(fields Fields) Entry
	WithField(name string, value interface{}) Entry
	WithError(err error) Entry
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger describes the interface that must be implemeted by all loggers.

func DefaultNopLogger

func DefaultNopLogger() Logger

DefaultNopLogger returns a nop logger.

func NewLoggerWithLogrus

func NewLoggerWithLogrus(logger *logrus.Logger) Logger

NewLoggerWithLogrus creates a new logger which wraps the given logrus.Logger

func NewLoggerWithLumberjack

func NewLoggerWithLumberjack(logf pkg.Log) Logger

type Lumberjack

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

func (*Lumberjack) Fire

func (hook *Lumberjack) Fire(entry *logrus.Entry) error

func (*Lumberjack) Levels

func (hook *Lumberjack) Levels() []logrus.Level

type NullFormatter

type NullFormatter struct {
}

NullFormatter formats logs into text

func (*NullFormatter) Format

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

Format renders a single log entry

Jump to

Keyboard shortcuts

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