prettierzap

package
v0.9.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateOutputString

func GenerateOutputString(pj ParsedJSON, emoji bool) (string, error)

GenerateOutputString generates the formatted output string for the given parsed JSON.

func PrettyPrint

func PrettyPrint(w io.Writer, pj ParsedJSON, f LogFilter, emoji bool) error

PrettyPrint writes the pretty version of the parsed JSON in the given writer.

Types

type LogFilter

type LogFilter struct {
	Level     string
	Timestamp string
	Caller    string
	Meta      map[string]*string
}

LogFilter represents a filter that is used for filter logs based on specific fields

type ParsedJSON

type ParsedJSON interface {
	GetLevel() string
	GetTimestamp() string
	GetCaller() string
	GetMsg() string
	GetMeta() map[string]string
}

ParsedJSON represents a parsed zap json object.

func ParseJSONByteArray

func ParseJSONByteArray(jsonByte []byte) (ParsedJSON, bool)

ParseJSONByteArray parses the given byte array and creates a ParsedJSON object.

Jump to

Keyboard shortcuts

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