logr

package
v0.0.0-...-1aed651 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...interface{})

func Debugf

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

func Error

func Error(v ...interface{})

func Errorf

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

func Info

func Info(v ...interface{})

func Infof

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

func NewLogrusInstance

func NewLogrusInstance(cfg *Config) *logrusInstance

func SetDefault

func SetDefault(l Interface)

func Warn

func Warn(v ...interface{})

func Warnf

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

Types

type Config

type Config struct {
	//nolint
	lumberjack.Logger `json:",inline,squash"`

	Level string `json:"level"` // info, warn, error, debug
}

type Interface

type Interface interface {
	logger.UniversalInterface

	Level() LevelType
	WithField(key string, val interface{}) Interface
	WithFields(fields map[string]interface{}) Interface
	WithError(err error) Interface
}

func StdLogger

func StdLogger() Interface

func WithError

func WithError(err error) Interface

func WithField

func WithField(key string, val interface{}) Interface

func WithFields

func WithFields(fields map[string]interface{}) Interface

type LevelType

type LevelType = string
const (
	InfoLevel  LevelType = "info"
	DebugLevel LevelType = "debug"
)

func Level

func Level() LevelType

Jump to

Keyboard shortcuts

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