log

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelCrit  = log15.LvlCrit
	LevelError = log15.LvlError
	LevelWarn  = log15.LvlWarn
	LevelInfo  = log15.LvlInfo
	LevelDebug = log15.LvlDebug
)

Variables

This section is empty.

Functions

func Crit

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

func Critf

func Critf(format string, values ...interface{})

func Debug

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

func Debugf

func Debugf(format string, values ...interface{})

func Error

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

func Errorf

func Errorf(format string, values ...interface{})

func Info

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

func Infof

func Infof(format string, values ...interface{})

func Setup

func Setup(lv log15.Lvl, toFile bool, showCodeLine bool)

Setup change the log config immediately The lv is higher the more logs would be visible

func TerminalFormat

func TerminalFormat(usecolor bool, showCodeLine bool) log15.Format

TerminalFormat formats log records optimized for human readability on a terminal with color-coded level output and terser human friendly timestamp. This format should only be used for interactive programs or while developing.

[TIME] [LEVEL] MESAGE key=value key=value ...

Example:

[May 16 20:58:45] [DBUG] remove route ns=haproxy addr=127.0.0.1:50002

func Warn

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

func Warnf

func Warnf(format string, values ...interface{})

Types

type Lazy

type Lazy = log15.Lazy

Lazy allows you to defer calculation of a logged value that is expensive to compute until it is certain that it must be evaluated with the given filters.

Lazy may also be used in conjunction with a Logger's New() function to generate a child logger which always reports the current value of changing state.

You may wrap any function which takes no arguments to Lazy. It may return any number of values of any type.

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