formatter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldKeyMsg   = "msg"
	FieldKeyLevel = "level"
	FieldKeyTime  = "time"

	FieldValueLevel = "NONE"
)

Default key names for the default fields

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFormatter

type JSONFormatter struct {
	// TimestampFormat sets the format used for marshaling timestamps.
	TimestampFormat string

	// DisableTimestamp allows disabling automatic timestamps in output
	DisableTimestamp bool

	// DataKey allows users to put all the log entry parameters into a nested dictionary at a given key.
	DataKey string

	// PrettyPrint will indent all json logs
	PrettyPrint bool
}

JSONFormatter formats logs into parsable json

func (*JSONFormatter) Format

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

Format renders a single log entry

type Termios

type Termios unix.Termios

type TextFormatter

type TextFormatter struct {
	// Set to true to bypass checking for a TTY before outputting colors.
	ForceColors bool

	// Force disabling colors.
	DisableColors bool

	// Disable timestamp logging. useful when output is redirected to logging
	// system that already adds timestamps.
	DisableTimestamp bool

	// TimestampFormat to use for display when a full timestamp is printed
	TimestampFormat string

	// Disables the truncation of the level text to 4 characters.
	DisableLevelTruncation bool
	// contains filtered or unexported fields
}

TextFormatter formats logs into text

func (*TextFormatter) Format

func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry

Jump to

Keyboard shortcuts

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