log

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package log provides a logger. The logger currently wraps sirupsen/logrus's Logger but it could be easily replaced.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

Level represents a logging level We don't use logrus's level because we want to implement UnmarshalText Also, we don't expose as many levels as logrus.

const (
	ErrorLevel Level = iota
	WarningLevel
	InfoLevel
)

Logging levels

func (Level) String added in v0.9.1

func (level Level) String() string

func (*Level) UnmarshalText added in v0.9.1

func (level *Level) UnmarshalText(text []byte) error

UnmarshalText will parse a log level

type Logger

type Logger interface {
	Error(...interface{})
	Errorf(string, ...interface{})
	Warning(...interface{})
	Warningf(string, ...interface{})
	Info(...interface{})
	Infof(string, ...interface{})
	PrefixLogger(string) Logger
	SetLevel(Level)
}

Logger is used to log error, warning and info messages

func New

func New(output io.Writer) Logger

New creates a new logger

Directories

Path Synopsis
Package http implements logging primitives for the http package
Package http implements logging primitives for the http package

Jump to

Keyboard shortcuts

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