logger

package
v0.0.0-...-2f0b01f Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidLogLevel = errors.New("unrecognized log level")

Functions

This section is empty.

Types

type Level

type Level int

Level represents severity level while logging.

const (
	// Error level is used when logging errors.
	Error Level = iota + 1
	// Warn level is used when logging warnings.
	Warn
	// Info level is used when logging info data.
	Info
	// Debug level is used when logging debugging info.
	Debug
)

func (Level) String

func (lvl Level) String() string

func (*Level) UnmarshalText

func (lvl *Level) UnmarshalText(text string) error

UnmarshalText returns log Level for the given string representation.

type Logger

type Logger interface {
	// Debug logs any object in JSON format on debug level.
	Debug(string)
	// Info logs any object in JSON format on info level.
	Info(string)
	// Warn logs any object in JSON format on warning level.
	Warn(string)
	// Error logs any object in JSON format on error level.
	Error(string)
}

Logger specifies logging API.

func New

func New(out io.Writer, levelText string) (Logger, error)

New returns wrapped go kit logger.

Jump to

Keyboard shortcuts

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