logger

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int

LogLevel stands for log levels

const (
	None LogLevel = iota
	Debug
	Error
)

Log levels

type Logger

type Logger struct {
	Debug *log.Logger
	Error *log.Logger
}

Logger offers logging methods

func New

func New() *Logger

New returns a logger

func (*Logger) LogCloseError

func (l *Logger) LogCloseError(closer io.Closer)

LogCloseError reports a closing error

Example
logger := &Logger{
	Error: log.New(os.Stdout, "", 0),
}
logger.LogCloseError(closerFunc(func() error { return errors.New("error") }))
logger = &Logger{
	Error: log.New(os.Stdout, "", 0),
}
logger.LogCloseError(closerFunc(func() error { return nil }))
Output:

error

Jump to

Keyboard shortcuts

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