logger

package
v0.0.0-...-6e30ed0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2017 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger func(errorMessage string) // don't touch it, if we add functions on Logger type,

Logger is a simple interface which is used to log critical messages (aka panics).

func NewDev

func NewDev() Logger

NewDev returns a new Logger which prints the critical messages to the console.

Example
logger := NewDev()

logger("It should print to the console")
Output:

It should print to the console

func NewFromWriter

func NewFromWriter(w io.Writer) Logger

NewFromWriter returns a new Logger which writes to the writer.

func NewProd

func NewProd() Logger

NewProd returns a new Logger which prints nothing.

Example
logger := NewProd()

logger("It shouldn't print a thing!")
Output:

Jump to

Keyboard shortcuts

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