encoder

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSONEncoder added in v1.0.1

func NewJSONEncoder() zapcore.Encoder

func NewTextColorEncoder

func NewTextColorEncoder() zapcore.Encoder

func NewTextEncoder

func NewTextEncoder(isTerminal bool) zapcore.Encoder

NewTextEncoder creates a fast, low-allocation TEXT encoder. The encoder appropriately escapes all field keys and values.

Note that the encoder doesn't deduplicate keys, so it's possible to produce a message like {"foo":"bar","foo":"baz"} This is permitted by the TEXT specification, but not encouraged. Many libraries will ignore duplicate key-value pairs (typically keeping the last pair) when unmarshaling, but users should attempt to avoid adding duplicate keys.

func NewTextNoColorEncoder

func NewTextNoColorEncoder() zapcore.Encoder

Types

type ColorScheme

type ColorScheme struct {
	InfoLevelStyle  string
	WarnLevelStyle  string
	ErrorLevelStyle string
	FatalLevelStyle string
	PanicLevelStyle string
	DebugLevelStyle string
	PrefixStyle     string
	TimestampStyle  string
}

Jump to

Keyboard shortcuts

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