logrus

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2017 License: Apache-2.0 Imports: 13 Imported by: 26

Documentation

Index

Constants

View Source
const DefaultTimestampFormat = time.RFC3339

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFormatter

type JSONFormatter struct {
	log.JSONFormatter
}

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(entry *log.Entry) ([]byte, error)

type TextFormatter

type TextFormatter struct {
	log.TextFormatter
	sync.Once
	// contains filtered or unexported fields
}

TextFormatter generates golf-enabled logs in plain-text formt.

The Formatter interface is used to implement a custom Formatter. It takes an `Entry`. It exposes all the fields, including the default ones:

* `entry.Data["msg"]`. The message passed from Info, Warn, Error .. * `entry.Data["time"]`. The timestamp. * `entry.Data["level"]. The level the entry was logged at.

Any additional fields added with `WithField` or `WithFields` are also in `entry.Data`. Format is expected to return an array of bytes which are then logged to `logger.Out`.

More information at https://github.com/akutz/logrus/blob/master/formatter.go

func (*TextFormatter) Format

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

Jump to

Keyboard shortcuts

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