Documentation ¶
Index ¶
- Constants
- Variables
- func GetLoc(skip int) (output string)
- func JoinStrings(a ...any) (s string)
- func New(writer io.Writer) (l *Log, c *Check, errorf *Errorf)
- func UnixNanoAsFloat() (s string)
- type C
- type Check
- type Chk
- type Entry
- type Err
- type Errorf
- type F
- type LevelPrinter
- type LevelSpec
- type Ln
- type Log
- type S
Constants ¶
View Source
const ( Off = iota Fatal Error Warn Info Debug Trace )
Variables ¶
View Source
var ( // LevelSpecs specifies the id, string name and color-printing function LevelSpecs = []LevelSpec{ {Off, " ", fmt.Sprint}, {Fatal, "FTL", fmt.Sprint}, {Error, "ERR", fmt.Sprint}, {Warn, "WRN", fmt.Sprint}, {Info, "INF", fmt.Sprint}, {Debug, "DBG", fmt.Sprint}, {Trace, "TRC", fmt.Sprint}, } )
Functions ¶
func JoinStrings ¶
Types ¶
type C ¶
type C func(closure func() string)
C accepts a function so that the extra computation can be avoided if it is not being viewed
type Err ¶
Err is a pass-through function that uses fmt.Errorf to construct an error and returns the error after printing it to the log
type F ¶
type F func(format string, a ...interface{})
F prints like fmt.Println surrounded by log details
type LevelPrinter ¶
func GetPrinter ¶
func GetPrinter(l int32, writer io.Writer) LevelPrinter
type Log ¶
type Log struct {
F, E, W, I, D, T LevelPrinter
}
Log is a set of log printers for the various Level items.
Click to show internal directories.
Click to hide internal directories.