logging

package module
v0.0.0-...-fa7f7e4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

View Source
const (
	LogLevelDebug   = "DEBUG"
	LogLevelInfo    = "INFO"
	LogLevelWarning = "WARN"
	LogLevelError   = "ERROR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Formatter

type Formatter interface {
	Format(*logEntry) (string, error)
}

type JSONFormatter

type JSONFormatter struct{}

func (JSONFormatter) Format

func (JSONFormatter) Format(l *logEntry) (string, error)

type Logger

type Logger interface {
	WithField(key string, value interface{}) Logger
	WithError(err error) Logger

	Info(msg string)
	Debug(msg string)
	Warn(msg string)
	Error(msg string)
}

func NewLogger

func NewLogger(output io.Writer, f Formatter, level string) Logger

Jump to

Keyboard shortcuts

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