formatter

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallerFormat

func CallerFormat(caller *runtime.Frame) string

CallerFormat format entry caller as text with fmt.Sprintf

func DefaultFormat

func DefaultFormat(value interface{}) string

DefaultFormat format value as text with fmt.Sprintf

func JSONFormat

func JSONFormat(value interface{}) string

JSONFormat format value as json

func NeedsQuoting

func NeedsQuoting(text string) bool

NeedsQuoting checks quoting needed for text

Types

type TextFormatter

type TextFormatter struct {
	logrus.TextFormatter

	SourceField  string
	FormatValue  func(value interface{}) string
	FormatCaller func(caller *runtime.Frame) string
	// contains filtered or unexported fields
}

TextFormatter formats logs into text

func New

func New() *TextFormatter

New creates new formatter

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