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 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址