json

package
v1.0.0-dev.11 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...Option) logrus.Formatter

New returns a new logrus formatter for JSON.

Types

type Option

type Option func(formatter *logrus.JSONFormatter)

Option represents a JSON formatter option.

func WithDataKey

func WithDataKey(value string) Option

WithDataKey sets formatter's data key to value.

func WithDisableHTMLEscape

func WithDisableHTMLEscape(value bool) Option

WithDisableHTMLEscape sets formatter's disable HTML escape to value.

func WithDisableTimestamp

func WithDisableTimestamp(value bool) Option

WithDisableTimestamp sets formatter's disable timestamp to value.

func WithFieldMap

func WithFieldMap(value logrus.FieldMap) Option

WithFieldMap sets formatter's field map to value.

func WithPrettyPrint

func WithPrettyPrint(value bool) Option

WithPrettyPrint sets formatter's pretty print to value.

func WithTimestampFormat

func WithTimestampFormat(value string) Option

WithTimestampFormat sets formatter's timestamp format to value. The format to use is the same than for time.Format or time.Parse from the standard library.

Jump to

Keyboard shortcuts

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