logger

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields = map[string]interface{}

type Logger

type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Warn(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Panic(args ...interface{})
	Panicf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Trace(args ...interface{})
	Tracef(format string, args ...interface{})
	WithFields(fields Fields) Logger
}

func NewLogrusLogger

func NewLogrusLogger() Logger

type LogrusConfig

type LogrusConfig struct {
	// one of: panic, fatal, error, info, debug, trace
	LogLevel string `env:"SVC_LOG_LEVEL"`
	// one of: pretty, json
	LogFormat string `env:"SVC_LOG_FORMAT"`
}
var LogrusCfg LogrusConfig

type LogrusLogger

type LogrusLogger struct {
	*logrus.Entry
}

func (LogrusLogger) WithFields

func (l LogrusLogger) WithFields(fields Fields) Logger

Jump to

Keyboard shortcuts

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