log

package
v0.3.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, ctx ...interface{})

func Error

func Error(msg string, ctx ...interface{})

func Info

func Info(msg string, ctx ...interface{})

Types

type Ctx

type Ctx map[string]interface{}

Ctx is a map of key/value pairs to pass as context to a log function Use this only if you really need greater safety around the arguments you pass to the logging functions.

type Logger

type Logger interface {
	Printf(format string, params ...interface{})
	Println(format string, params ...interface{})
	Debug(msg string, ctx ...interface{})
	Info(msg string, ctx ...interface{})
	Error(msg string, ctx ...interface{})
}

func Test

func Test() Logger

func With

func With(kv ...interface{}) Logger

type LoggerImpl

type LoggerImpl struct {
	// contains filtered or unexported fields
}

func (*LoggerImpl) Debug

func (l *LoggerImpl) Debug(msg string, ctx ...interface{})

func (*LoggerImpl) Error

func (l *LoggerImpl) Error(msg string, ctx ...interface{})

func (*LoggerImpl) Info

func (l *LoggerImpl) Info(msg string, ctx ...interface{})

func (*LoggerImpl) Printf

func (l *LoggerImpl) Printf(format string, params ...interface{})

func (*LoggerImpl) Println

func (l *LoggerImpl) Println(format string, params ...interface{})

type TerminalStringer

type TerminalStringer interface {
	TerminalString() string
}

TerminalStringer is an analogous interface to the stdlib stringer, allowing own types to have custom shortened serialization formats when printed to the screen.

Jump to

Keyboard shortcuts

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