package log
import "github.com/golang/gddo/log"
Index ¶
- func Crit(ctx context.Context, msg string, logCtx ...interface{})
- func Debug(ctx context.Context, msg string, logCtx ...interface{})
- func Error(ctx context.Context, msg string, logCtx ...interface{})
- func Fatal(ctx context.Context, msg string, logCtx ...interface{})
- func FromContext(ctx context.Context) log15.Logger
- func Info(ctx context.Context, msg string, logCtx ...interface{})
- func NewContext(ctx context.Context, l log15.Logger) context.Context
- func NewHTTPContextHandler(h http.Handler, l log15.Logger, onAppEngine bool) http.Handler
- func Warn(ctx context.Context, msg string, logCtx ...interface{})
Functions ¶
func Crit ¶
Crit is a convenient alias for FromContext(ctx).Crit
func Debug ¶
Debug is a convenient alias for FromContext(ctx).Debug
func Error ¶
Error is a convenient alias for FromContext(ctx).Error
func Fatal ¶
Fatal is equivalent to Crit() followed by a call to os.Exit(1).
func FromContext ¶
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 ¶
Info is a convenient alias for FromContext(ctx).Info
func NewContext ¶
NewContext creates a new context containing the given logger. It is not recommended for use and may be removed in the future.
func NewHTTPContextHandler ¶
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 ¶
Warn is a convenient alias for FromContext(ctx).Warn
Source Files ¶
- Version
- v0.0.0-20210115222349-20d68f94ee1f (latest)
- Published
- Jan 15, 2021
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 6 hours ago –
Tools for package owners.