log

package
v0.0.0-...-20d68f9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: BSD-3-Clause Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crit

func Crit(ctx context.Context, msg string, logCtx ...interface{})

Crit is a convenient alias for FromContext(ctx).Crit

func Debug

func Debug(ctx context.Context, msg string, logCtx ...interface{})

Debug is a convenient alias for FromContext(ctx).Debug

func Error

func Error(ctx context.Context, msg string, logCtx ...interface{})

Error is a convenient alias for FromContext(ctx).Error

func Fatal

func Fatal(ctx context.Context, msg string, logCtx ...interface{})

Fatal is equivalent to Crit() followed by a call to os.Exit(1).

func FromContext

func FromContext(ctx context.Context) log15.Logger

FromContext always returns a logger. If there is no logger in the context, it returns the root logger. It is not recommended for use and may be removed in the future.

func Info

func Info(ctx context.Context, msg string, logCtx ...interface{})

Info is a convenient alias for FromContext(ctx).Info

func NewContext

func NewContext(ctx context.Context, l log15.Logger) context.Context

NewContext creates a new context containing the given logger. It is not recommended for use and may be removed in the future.

func NewHTTPContextHandler

func NewHTTPContextHandler(h http.Handler, l log15.Logger, onAppEngine bool) http.Handler

NewHTTPContextHandler adds a context logger based on the given logger to each request. After a request passes through this handler, Error(req.Context(), "foo") will log to that logger and add useful context to each log entry.

func Warn

func Warn(ctx context.Context, msg string, logCtx ...interface{})

Warn is a convenient alias for FromContext(ctx).Warn

Types

This section is empty.

Jump to

Keyboard shortcuts

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