logger

package
v0.0.0-...-6eb78be Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logger contains logger API definition, wrapper that can be used around any other logger.

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

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