fmt15

package module
v0.0.0-...-ee69fec Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: Apache-2.0 Imports: 6 Imported by: 22

README

fmt15

Logging format for log15

Documentation

Index

Constants

View Source
const (
	DefTimeFmt         = "2006-01-02T15:04:05.000-0700"
	DefFloatFmt        = 'f'
	DefTermMsgJust     = 40
	DefMultilinePrefix = ">  "
	DefColorFmt        = "\x1b[%dm%s\x1b[0m"
	ErrorKey           = "LOG15_ERROR"
)

Variables

View Source
var (
	TimeFmt         = DefTimeFmt
	FloatFmt        = DefFloatFmt
	TermMsgJust     = DefTermMsgJust
	MultilinePrefix = DefMultilinePrefix
	ColorFmt        = DefColorFmt
)
View Source
var ColorMap = map[log15.Lvl]int{
	log15.LvlCrit: 35, log15.LvlError: 31, log15.LvlWarn: 33,
	log15.LvlInfo: 32, log15.LvlDebug: 36,
}

Functions

func ColorStr

func ColorStr(s string, color int) string

func Fmt15

func Fmt15(buf *bytes.Buffer, r *log15.Record, color int)

func Fmt15Format

func Fmt15Format(colorMap map[log15.Lvl]int) log15.Format

func FmtMultiLine

func FmtMultiLine(s string) string

func FmtValue

func FmtValue(val interface{}) string

Types

type FCtx

type FCtx []interface{}

Jump to

Keyboard shortcuts

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