formatter

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldSerializerFormatter added in v0.4.8

type FieldSerializerFormatter struct {
	Formatter         logrus.Formatter
	UseJSONRawMessage bool // If true, then json.RawMessage type will be used for fields serialized to JSON.
}

FieldSerializerFormatter will serialize the log field values to basic types. Other types will be serialized to JSON.

func (*FieldSerializerFormatter) Format added in v0.4.8

func (f *FieldSerializerFormatter) Format(e *logrus.Entry) ([]byte, error)

type JSONFormatter

type JSONFormatter struct {
	// contains filtered or unexported fields
}

JSONFormatter is a wrapper for the original JSONFormatter from the logrus package. It changes the timezone of logs to UTC.

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(e *logrus.Entry) ([]byte, error)

type XFilterFormatter

type XFilterFormatter struct {
	Formatter logrus.Formatter
}

XFilterFormatter removes all fields with the "x-" prefix. This will allow adding more data fields to logs without making the CLI output to messy.

func (*XFilterFormatter) Format

func (f *XFilterFormatter) Format(e *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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