logger

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel uint

LogLevel defines a type for named log levels

const (
	Error LogLevel = iota
	Warning
	Info
	Debug
)

Pre-Defined log levels to be used with this logging module

type Logger

type Logger struct {
	Level LogLevel
}

Logger is a wrapper around output to filter according to levels

func New

func New(logLevel LogLevel) *Logger

New instanciates a new Logger and sets the preferred log level

func (*Logger) DebugF

func (l *Logger) DebugF(line string, args ...interface{})

DebugF executes LogF with Debug level

func (*Logger) ErrorF

func (l *Logger) ErrorF(line string, args ...interface{})

ErrorF executes LogF with Error level

func (*Logger) InfoF

func (l *Logger) InfoF(line string, args ...interface{})

InfoF executes LogF with Info level

func (*Logger) Log

func (l *Logger) Log(level LogLevel, line string)

Log is the filtered equivalent to fmt.Println

func (*Logger) LogF

func (l *Logger) LogF(level LogLevel, line string, args ...interface{})

LogF is the filtered equivalent to fmt.Printf

Jump to

Keyboard shortcuts

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