log

package
v1.1.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TraceLevel = logrus.Level(uint32(logrus.DebugLevel + 1))

TraceLevel is the log level for tracing. Trace level is lower than debug level, and is usually used to trace detailed behavior of the program.

Variables

View Source
var (
	// G is an alias for GetLogger.
	//
	// We may want to define this locally to a package to get package tagged log
	// messages.
	G = GetLogger

	// L is an alias for the the standard logger.
	L = logrus.NewEntry(logrus.StandardLogger())
)

Functions

func GetLogger

func GetLogger(ctx context.Context) *logrus.Entry

GetLogger retrieves the current logger from the context. If no logger is available, the default logger is returned.

func ParseLevel added in v1.1.0

func ParseLevel(lvl string) (logrus.Level, error)

ParseLevel takes a string level and returns the Logrus log level constant. It supports trace level.

func Trace added in v1.1.0

func Trace(e *logrus.Entry, args ...interface{})

Trace logs a message at level Trace with the log entry passed-in.

func Tracef added in v1.1.0

func Tracef(e *logrus.Entry, format string, args ...interface{})

Tracef logs a message at level Trace with the log entry passed-in.

func WithLogger

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

WithLogger returns a new context with the provided logger. Use in combination with logger.WithField(s) for great effect.

Types

This section is empty.

Jump to

Keyboard shortcuts

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