output

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultOutput

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

DefaultOutput provides logs and metadata in human readable format

func (*DefaultOutput) Format

func (o *DefaultOutput) Format(ts time.Time, lbls loghttp.LabelSet, maxLabelsLen int, line string) string

Format a log entry in a human readable format

type JSONLOutput

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

JSONLOutput prints logs and metadata as JSON Lines, suitable for scripts

func (*JSONLOutput) Format

func (o *JSONLOutput) Format(ts time.Time, lbls loghttp.LabelSet, maxLabelsLen int, line string) string

Format a log entry as json line

type LogOutput

type LogOutput interface {
	Format(ts time.Time, lbls loghttp.LabelSet, maxLabelsLen int, line string) string
}

LogOutput is the interface any output mode must implement

func NewLogOutput

func NewLogOutput(mode string, options *LogOutputOptions) (LogOutput, error)

NewLogOutput creates a log output based on the input mode and options

type LogOutputOptions

type LogOutputOptions struct {
	Timezone *time.Location
	NoLabels bool
}

LogOutputOptions defines options supported by LogOutput

type RawOutput

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

RawOutput prints logs in their original form, without any metadata

func (*RawOutput) Format

func (o *RawOutput) Format(ts time.Time, lbls loghttp.LabelSet, maxLabelsLen int, line string) string

Format a log entry as is

Jump to

Keyboard shortcuts

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