wlogtmpl

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggerProvider

func LoggerProvider(cfg *Config, params ...logentryformatter.Param) wlog.LoggerProvider

LoggerProvider returns a wlog.LoggerProvider which formats log entries with wlog templates. The default templates give a human-friendly output suitable for command-line tools. Services which leverage log collection infrastructure should use a JSON-based provider.

Nil configuration is valid and will result in the default behavior.

Types

type Config

type Config struct {
	// Strict mode emits formatting errors as log lines; by default, the raw output will be printed if it can't be formatted.
	Strict        bool
	UnwrapperMap  map[logentryformatter.LogType]logentryformatter.Unwrapper
	FormatterMap  map[logentryformatter.LogType]logentryformatter.Formatter
	Only, Exclude map[logentryformatter.LogType]struct{}
	// DelegateLogger is used to create the intermediate json representation that is passed to the template.
	DelegateLogger wlog.LoggerProvider
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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