logformats

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = &logging.TextFormatter{
	FullTimestamp:   true,
	TimestampFormat: "2006-01-02 15:04:05",
	ForceColors:     true,
	CallerPrettyfier: func(frame *runtime.Frame) (string, string) {
		s := strings.Split(frame.Function, ".")
		funcName := "[" + s[len(s)-1] + "]"
		fileName := " [" + path.Base(frame.File) + ":" + strconv.Itoa(frame.Line) + "]"
		return funcName, fileName
	},
}

Debug is the debug formatter for our logs, it prints aditional data to aid with debugging

View Source
var Default = &logging.TextFormatter{
	FullTimestamp:    true,
	TimestampFormat:  "2006-01-02 15:04:05",
	ForceColors:      true,
	CallerPrettyfier: func(frame *runtime.Frame) (string, string) { return "", "" },
}

Default is the default formatter for our logs

View Source
var Fuzz = &logging.TextFormatter{
	DisableColors: true,
	FullTimestamp: true,
}

Fuzz is the formatter used in our fuzz tests

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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