formatter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: MIT Imports: 5 Imported by: 93

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	NoUseColors bool
}

CLI is a formatter for outputting CLI logs

func (*CLI) Format

func (c *CLI) Format(event *LogEvent) ([]byte, error)

Format formats the log event data into bytes

type Formatter

type Formatter interface {
	// Format formats the log event data into bytes
	Format(event *LogEvent) ([]byte, error)
}

Formatter type format raw logging data into something useful

type JSON

type JSON struct{}

JSON is a formatter for outputting json logs

func (*JSON) Format

func (j *JSON) Format(event *LogEvent) ([]byte, error)

Format formats the log event data into bytes

type LogEvent

type LogEvent struct {
	Message  string
	Level    levels.Level
	Metadata map[string]string
}

LogEvent is the respresentation of a single event to be logged.

Jump to

Keyboard shortcuts

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