gddo: github.com/golang/gddo/log Index | Files

package log

import "github.com/golang/gddo/log"

Index

Package Files

http_handler.go log.go

func Crit Uses

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

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

func Debug Uses

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

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

func Error Uses

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

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

func Fatal Uses

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

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

func FromContext Uses

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 Uses

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

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

func NewContext Uses

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 Uses

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 Uses

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

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

Package log imports 7 packages (graph) and is imported by 5 packages. Updated 2018-12-22. Refresh now. Tools for package owners.