Help us shape the future of Go! Take the 2026 Go Developer Survey

log

package module
v0.0.0-...-46b4444 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: MIT Imports: 7 Imported by: 0

README

Log

Go logging simplified.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level uint8
const (
	FATAL Level = iota
	ERROR
	WARN
	INFO
	DEBUG
)

func (Level) String

func (level Level) String() string

type Logger

type Logger interface {
	V(Level) V
}

func New

func New(options ...Option) Logger

type Option

type Option func(*log)

func WithExitFunc

func WithExitFunc(f func(exitCode int)) Option

func WithFatalFunc

func WithFatalFunc(f func(level Level) bool) Option

func WithField

func WithField(key string, value interface{}) Option

func WithLevelsFunc

func WithLevelsFunc(f func(level Level) (levelName string)) Option

func WithTimeFormat

func WithTimeFormat(tf string) Option

func WithVerbosityFunc

func WithVerbosityFunc(f func(level Level) bool) Option

func WithWriterFunc

func WithWriterFunc(f func(level Level) io.Writer) Option

type V

type V interface {
	Err(error)
	Str(string)
}

Jump to

Keyboard shortcuts

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