logger

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2016 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 Crit

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

func Debug

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

func Error

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

func Info

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

func Warn

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

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 {
	Debug(msg string, pairs ...interface{})
	Info(msg string, pairs ...interface{})
	Warn(msg string, pairs ...interface{})
	Error(msg string, pairs ...interface{})
	Crit(msg string, pairs ...interface{})
}

Logger represents a structured leveled 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