prettylog

package
v0.0.0-...-05bc493 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ConvertJSONLogForConsole = false
View Source
const TimestampFormat = "2006-01-02T15:04:05.000000000Z07:00"

Variables

View Source
var Defaults = Config{
	NoColor:      true,
	TimeFormat:   TimestampFormat,
	FormatCaller: formatCaller,
	PartsOrder: []string{
		logoutput.TimestampFieldName,
		logoutput.LevelFieldName,
		logoutput.MessageFieldName,
		logoutput.CallerFieldName,
	},
}

Functions

func ConvertJSONConsoleOutput

func ConvertJSONConsoleOutput(in io.Writer) io.Writer

Types

type Config

type Config struct {
	Enable bool

	// NoColor disables the colorized output.
	NoColor bool

	// TimeFormat specifies the format for timestamp in output.
	TimeFormat string

	// PartsOrder defines the order of parts in output.
	PartsOrder []string

	FormatTimestamp     Formatter
	FormatLevel         Formatter
	FormatCaller        Formatter
	FormatMessage       Formatter
	FormatFieldName     Formatter
	FormatFieldValue    Formatter
	FormatErrFieldName  Formatter
	FormatErrFieldValue Formatter
}

type Formatter

type Formatter = func(interface{}) string

Jump to

Keyboard shortcuts

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