log

package
v0.0.0-...-ffa6674 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 5 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// CatTrace is the level for trace messages
	CatTrace = iota
	// CatDebug is the level for debug messages
	CatDebug
	// CatInfo is the level for info messages
	CatInfo
	// CatWarn is the level for warn messages
	CatWarn
	// CatError is the level for error messages
	CatError
	// CatFatal is the level for fatal messages
	CatFatal
)

Variables

View Source
var CurrentConfig = Config{
	MinLevel:        CatTrace,
	MaxLevel:        CatFatal,
	Timestamp:       true,
	TimestampFormat: "%02d:%02d:%02d.%03d | ",
	Category:        true,
	CategoryFormat:  "% 5s | ",
}

CurrentConfig is the configuration currently used for logging

Functions

func Debug

func Debug(s string, args ...interface{})

Debug log message

func Error

func Error(s string, args ...interface{})

Error log message

func Fatal

func Fatal(s string, args ...interface{})

Fatal log message

func Info

func Info(s string, args ...interface{})

Info log message

func Trace

func Trace(s string, args ...interface{})

Trace log message

func Warn

func Warn(s string, args ...interface{})

Warn log message

Types

type Config

type Config struct {
	MinLevel        int
	MaxLevel        int
	Timestamp       bool
	TimestampFormat string
	Category        bool
	CategoryFormat  string
}

Config contains instructions on how to write log to stdout

Jump to

Keyboard shortcuts

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