log

package
v0.14.1-test Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 6 Imported by: 92

Documentation

Index

Constants

View Source
const Error = Level("error")

Error sets level=error in the log output

View Source
const Fatal = Level("fatal")

Fatal sets level=fatal in the log output

View Source
const Info = Level("info")

Info is sets level=info in the log output

View Source
const Warn = Level("warn")

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context interface {
	Context() map[string]interface{}
}

type Fields

type Fields map[string]interface{}

func (Fields) Context

func (f Fields) Context() map[string]interface{}

type Level

type Level string

Level just wraps a string to be able to add Context specific to log levels

func (Level) Context

func (l Level) Context() map[string]interface{}

Context returns the map that states that key value of `level={{l}}`

type LoggedError added in v0.13.0

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

func (LoggedError) Err added in v0.13.0

func (l LoggedError) Err() error

type Logger

type Logger interface {
	Set(key string, value interface{}) Logger
	With(ctxs ...Context) Logger

	Info() Logger
	Warn() Logger
	Error() Logger
	Fatal() Logger

	Log(message string)
	Logf(format string, args ...interface{})
	Send()

	LogError(error error) LoggedError
	LogErrorf(format string, args ...interface{}) LoggedError
}

func NewBufferLogger

func NewBufferLogger() (*strings.Builder, Logger)

func NewDefaultLogger

func NewDefaultLogger() Logger

func NewJSONLogger

func NewJSONLogger() Logger

func NewLogger

func NewLogger(writer log.Logger) Logger

func NewNopLogger

func NewNopLogger() Logger

Jump to

Keyboard shortcuts

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