log

package
v0.0.0-...-986c4a6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: MIT Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Args

type Args map[string]interface{}

func (Args) Count

func (a Args) Count() int

func (Args) ForEach

func (a Args) ForEach(f func(k string, v interface{}))

func (Args) String

func (a Args) String() string

type Level

type Level int
const (
	LevelFatal Level = iota
	LevelError
	LevelWarning
	LevelInfo
	LevelDebug
)

func LevelOf

func LevelOf(value string) Level

Matches the log level of FATAL/ERROR/WARNING/INFO/DEBUG case insensitively. Defaults to INFO if mismatches.

type Logger

type Logger interface {
	// Log message with INFO level.
	Info(message string, args Args)
	// Log message with DEBUG level.
	Debug(message string, args Args)
	// Log message with ERROR level.
	Error(message string, args Args)
	// Log message with WARNING level.
	Warning(message string, args Args)
	// Log message with FATAL level.
	Fatal(message string, args Args)
}

Service provider for logging.

func Default

func Default() Logger

Returns a Logger that uses Golang's native log package for logging. The logger also outputs the logging timestamp in RFC3339 format.

func None

func None() Logger

Returns a Logger that does nothing.

Jump to

Keyboard shortcuts

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