log

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

Debug logging.

func Debugf

func Debugf(msg string, args ...interface{})

Debugf logging.

func Error

func Error(args ...interface{})

Error logging.

func Errorf

func Errorf(msg string, args ...interface{})

Errorf logging.

func Fatal

func Fatal(args ...interface{})

Fatal logging.

func Fatalf

func Fatalf(msg string, args ...interface{})

Fatalf logging.

func Info

func Info(args ...interface{})

Info logging.

func Infof

func Infof(msg string, args ...interface{})

Infof logging.

func Panic

func Panic(args ...interface{})

Panic logging.

func Panicf

func Panicf(msg string, args ...interface{})

Panicf logging.

func Setup

func Setup(f FactoryFunc, fls map[string]interface{}) error

Setup logging by providing a logger factory.

func Warn

func Warn(args ...interface{})

Warn logging.

func Warnf

func Warnf(msg string, args ...interface{})

Warnf logging.

func WithContext added in v0.11.0

func WithContext(ctx context.Context, l Logger) context.Context

WithContext associates a logger with a context for later reuse.

Types

type FactoryFunc added in v0.4.6

type FactoryFunc func(map[string]interface{}) Logger

FactoryFunc function type for creating loggers.

type Level

type Level string

The Level type definition.

const (
	// DebugLevel level.
	DebugLevel Level = "debug"
	// InfoLevel level.
	InfoLevel Level = "info"
	// WarnLevel level.
	WarnLevel Level = "warn"
	// ErrorLevel level.
	ErrorLevel Level = "error"
	// FatalLevel level.
	FatalLevel Level = "fatal"
	// PanicLevel level.
	PanicLevel Level = "panic"
	// NoLevel level.
	NoLevel Level = ""
)

type Logger

type Logger interface {
	Sub(map[string]interface{}) Logger
	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Panic(...interface{})
	Panicf(string, ...interface{})
	Error(...interface{})
	Errorf(string, ...interface{})
	Warn(...interface{})
	Warnf(string, ...interface{})
	Info(...interface{})
	Infof(string, ...interface{})
	Debug(...interface{})
	Debugf(string, ...interface{})
}

Logger interface definition of a logger.

func FromContext added in v0.11.0

func FromContext(ctx context.Context) Logger

FromContext returns the logger in the context or a nil logger.

func Sub

func Sub(ff map[string]interface{}) Logger

Sub returns a sub logger with new fields attached.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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