Documentation ¶
Index ¶
- Constants
- Variables
- func GetLoc(skip int) (output string)
- func JoinStrings(a ...any) (s string)
- func New(level int, writer io.Writer) (l *Log, c *Check, errorf *Errorf)
- func SetLogLevel(level string)
- func SetLoggers(level int)
- func UnixTimeAsFloat() (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 Logger
- type S
Constants ¶
View Source
const ( Off = iota Fatal Error Warn Info Debug Trace )
Variables ¶
View Source
var LevelNames = []string{
"off",
"fatal",
"error",
"warn",
"info",
"debug",
"trace",
}
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 ¶
func SetLogLevel ¶ added in v0.0.14
func SetLogLevel(level string)
func SetLoggers ¶ added in v0.0.14
func SetLoggers(level int)
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 GetNullPrinter ¶ added in v0.0.14
func GetNullPrinter() 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.