logger

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2015 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Overview

package logger is a package that provides a structured logger that's context.Context aware.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(ctx context.Context, pairs ...interface{})

Log is a convenience method, which extracts a logger from the context object, then calls the Log method on it.

func WithLogger

func WithLogger(ctx context.Context, l Logger) context.Context

WithLogger inserts a log.Logger into the provided context.

Types

type Logger

type Logger interface {
	Log(pairs ...interface{})
}

Logger represents a structured logger.

func FromContext

func FromContext(ctx context.Context) (Logger, bool)

FromContext returns a log.Logger from the context.

func New

func New(l *log.Logger) Logger

New wraps the log.Logger to implement the Logger interface.

Jump to

Keyboard shortcuts

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