Documentation ¶
Overview ¶
log provides logging functions with level-prefixes and customized options. Logging flags are configured primarily for short-term usage, with date-flag disabled, and the time-flag and microseconds-flag enabled.
TODO consider providing option for adding terminal coloring. It would be nice to de-emphasize timestamp, emphasize log-level, and normalize at logged content. (os.Stdout.Fd() == 1, etc. Makes for easy testing if output is Std{Err,Out})
Index ¶
- func Debug(line string)
- func DebugReport(assert bool, format string, args ...any)
- func Debugf(format string, args ...any)
- func Debugln(args ...any)
- func DebuglnMap[K comparable, V any](prefix string, data map[K]V)
- func DebuglnSlice[T any](prefix string, data []T)
- func DebuglnSliceAsString(prefix string, data [][]byte)
- func Error(line string)
- func Errorf(format string, args ...any)
- func Errorln(args ...any)
- func Flags() int
- func Info(line string)
- func Infof(format string, args ...any)
- func Infoln(args ...any)
- func SetFlags(flags int)
- func SetOutput(output io.Writer)
- func SetTraceFlags(flags int)
- func SetTraceOutput(output io.Writer)
- func TraceFlags() int
- func TraceReport(assert bool, format string, args ...any)
- func Tracef(format string, args ...any)
- func TracefDepth(depth uint, format string, args ...any)
- func Traceln(args ...any)
- func TracelnDepth(depth uint, args ...any)
- func TracelnMap[K comparable, V any](prefix string, data map[K]V)
- func TracelnSliceAsString(prefix string, data [][]byte)
- func Tracing() bool
- func Warn(line string)
- func Warnf(format string, args ...any)
- func Warnln(args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DebugReport ¶
DebugReport logs a debug-level message in case the assertion does not hold.
func Debugln ¶
func Debugln(args ...any)
Debugln writes a line to os.Stderr with prefix `debug`, then ends with newline.
func DebuglnMap ¶
func DebuglnMap[K comparable, V any](prefix string, data map[K]V)
DebuglnMap prints each entry in `data` (every key in the map) on a new line. Every debug-line is prefixed with `prefix`.
func DebuglnSlice ¶
DebuglnSlice prints each entry in `data` on a new line. Every debug-line is prefixed with `prefix`.
func DebuglnSliceAsString ¶
DebuglnSliceAsString prints each entry in `data` on a new line. Every debug-line is prefixed with `prefix`. Each line of data (bytes), are printed as ANSI characters, thus converted to a string.
func Errorln ¶
func Errorln(args ...any)
Errorln writes a line to os.Stderr with prefix 'ERROR', closing with newline.
func Infoln ¶
func Infoln(args ...any)
Infoln writes a line to os.Stderr with prefix 'info', closing with newline.
func SetTraceFlags ¶
func SetTraceFlags(flags int)
func SetTraceOutput ¶
func TraceFlags ¶
func TraceFlags() int
func TraceReport ¶
func TracefDepth ¶
func TracelnDepth ¶
func TracelnMap ¶
func TracelnMap[K comparable, V any](prefix string, data map[K]V)
func TracelnSliceAsString ¶
Types ¶
This section is empty.