std

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2015 License: GPL-3.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NOLOG = iota
	FATAL
	ERROR
	INFO
	DEBUG
)

These are the different logging levels that are supported.

Variables

This section is empty.

Functions

This section is empty.

Types

type Standard

type Standard struct {
	// contains filtered or unexported fields
}

Standard is logging through the standard `log` package It can take an additional configuration element 'level' with string values of 'no_log', 'fatal', 'error' 'info' or 'debug'. The values says which calls to the logger to be actually logged. Saying a later value means that the previous ones should be logged as well - 'info' means that 'fatal' and 'error' should be logged as well.

func New

func New(cfg *config.Logger) (*Standard, error)

New returns a new configured Standard that is ready to use.

func (*Standard) Debug

func (n *Standard) Debug(args ...interface{})

Debug is the same as log.Println if level is atleast 'debug'

func (*Standard) Debugf

func (n *Standard) Debugf(format string, args ...interface{})

Debugf is the same as log.Printf, with a newline at the end of format if missing, if level is atleast 'debug'

func (*Standard) Error

func (n *Standard) Error(args ...interface{})

Error is the same as log.Println if level is atleast 'error'

func (*Standard) Errorf

func (n *Standard) Errorf(format string, args ...interface{})

Errorf is the same as log.Printf, with a newline at the end of format if missing, if level is atleast 'error'

func (*Standard) Fatal

func (n *Standard) Fatal(args ...interface{})

Fatal is the same as log.Fatalln if level is atleast 'fatal'

func (*Standard) Fatalf

func (n *Standard) Fatalf(format string, args ...interface{})

Fatalf is the same as log.Fatalf, with a newline at the end of format if missing, if level is atleast 'fatal'

func (*Standard) Log

func (n *Standard) Log(args ...interface{})

Log is the same as log.Println if level is atleast 'info'

func (*Standard) Logf

func (n *Standard) Logf(format string, args ...interface{})

Logf is the same as log.Printf, with a newline at the end of format if missing, if level is atleast 'info'

Jump to

Keyboard shortcuts

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