bvlog

package module
v0.0.0-...-85e4fe8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2015 License: GPL-2.0 Imports: 6 Imported by: 0

README

bvlog

Logging library for go

http://godoc.org/github.com/bvandre/bvlog

Currently the library will set up a logger first trying to setup the logger with journald. It then tries to setup the logger to syslog if journald isn't found.

Future

Will add additional logging backends, including stdout, file, and possibly windows logging services.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(exit bool, v ...interface{}) error

func Fatalf

func Fatalf(exit bool, format string, v ...interface{}) error

Fatalf and Fatal use the error prefix for logging. If you want the process to exit with an error code pass true for exit.

func Info

func Info(v ...interface{}) error

func Infof

func Infof(format string, v ...interface{}) error

Infof and Info use the info prefix for logging.

func Warn

func Warn(v ...interface{}) error

func Warnf

func Warnf(format string, v ...interface{}) error

Warnf and Warn use the warning prefix for logging.

Types

type Logger

type Logger interface {
	io.Writer
	io.Closer
	Infof(format string, v ...interface{}) error
	Info(v ...interface{}) error
	Warnf(format string, v ...interface{}) error
	Warn(v ...interface{}) error
	Fatalf(exit bool, format string, v ...interface{}) error
	Fatal(exit bool, v ...interface{}) error
}

The logger interface will be implemented by a few different types of loggers

This should abstract away the individual backend loggers

func NewJournalLogger

func NewJournalLogger() (Logger, error)

func NewSyslogLogger

func NewSyslogLogger() (Logger, error)

Jump to

Keyboard shortcuts

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