logging

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: Apache-2.0 Imports: 9 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 CreateLogger added in v1.6.0

func CreateLogger(ctx context.Context, logger string) *logrus.Entry

func Logger

func Logger(name string) *logrus.Logger

func LoggerEntry

func LoggerEntry(name string) *logrus.Entry

func LoggerEntryWithTag added in v1.6.0

func LoggerEntryWithTag(name string, tag string) *logrus.Entry

func Loggers

func Loggers() map[string]*logrus.Logger

func SetConfigureLoggerHandler added in v1.6.0

func SetConfigureLoggerHandler(handler func(string, *logrus.Logger))

Types

type StringValueFormatter added in v1.6.0

type StringValueFormatter string

StringValueFormatter is a string that provides value formatting for logging multiline string value.

func (StringValueFormatter) Print added in v1.6.0

func (f StringValueFormatter) Print(b *bytes.Buffer)

Print prints the string value to bytes buffer.

type TextFormatter added in v1.6.0

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

	// Enable logging the full timestamp when a TTY is attached instead of just
	// the time passed since beginning of execution.
	FullTimestamp bool

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

	// The fields are sorted by default for a consistent output. For applications
	// that log extremely frequently and don't use the JSON formatter this may not
	// be desired.
	DisableSorting bool

	// Disables the truncation of the level text to 4 characters.
	DisableLevelTruncation bool

	// QuoteEmptyFields will wrap empty fields in quotes if true
	QuoteEmptyFields bool

	sync.Once
	// contains filtered or unexported fields
}

TextFormatter formats logs into text

func (*TextFormatter) Format added in v1.6.0

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

Format renders a single log entry

type ValueFormatter added in v1.6.0

type ValueFormatter interface {
	Print(b *bytes.Buffer)
}

Jump to

Keyboard shortcuts

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