logger

package
v0.0.0-...-1a6bc1e Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2017 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int

LogLevel is an abstraction over int that allows to better undestand the input of SetLogLevel

const (
	DEBUG LogLevel = iota
	VERBOSE
	INFO
	WARNING
	ERROR
)

type LogOutput

type LogOutput int

Output enums to set the outputs

const (
	STDERR  LogOutput = 1 << (iota + 1)
	LOGFILE LogOutput = 1 << (iota + 1)
)

type ParanoidLogger

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

ParanoidLogger struct containing the variables necessary for the logger

func New

func New(currentPackage string, component string, logDirectory string) *ParanoidLogger

New creates a new logger and returns a new logger

func (*ParanoidLogger) AddAdditionalWriter

func (l *ParanoidLogger) AddAdditionalWriter(writer io.Writer)

AddAdditionalWriter allows to add a custom writer to the logger. This can be cleared by calling logger.SetOutput() again

func (*ParanoidLogger) Debug

func (l *ParanoidLogger) Debug(v ...interface{})

Debug only prints if LogLevel is set to DEBUG

func (*ParanoidLogger) Debugf

func (l *ParanoidLogger) Debugf(format string, v ...interface{})

Debug only prints if LogLevel is set to DEBUG

func (*ParanoidLogger) Error

func (l *ParanoidLogger) Error(v ...interface{})

Error only prints if LogLevel is set to ERROR or lower in importance

func (*ParanoidLogger) Errorf

func (l *ParanoidLogger) Errorf(format string, v ...interface{})

Error only prints if LogLevel is set to ERROR or lower in importance

func (*ParanoidLogger) Fatal

func (l *ParanoidLogger) Fatal(v ...interface{})

Fatal always prints and exits the program with exit code 1

func (*ParanoidLogger) Fatalf

func (l *ParanoidLogger) Fatalf(format string, v ...interface{})

Fatal always prints and exits the program with exit code 1

func (*ParanoidLogger) Info

func (l *ParanoidLogger) Info(v ...interface{})

Info only prints if LogLevel is set to INFO or lower in importance

func (*ParanoidLogger) Infof

func (l *ParanoidLogger) Infof(format string, v ...interface{})

Info only prints if LogLevel is set to INFO or lower in importance

func (*ParanoidLogger) SetLogLevel

func (l *ParanoidLogger) SetLogLevel(level LogLevel)

SetLogLevel sets the logging level for the logger

func (*ParanoidLogger) SetOutput

func (l *ParanoidLogger) SetOutput(output LogOutput) error

SetOutput sets the default output for the logger

func (*ParanoidLogger) Verbose

func (l *ParanoidLogger) Verbose(v ...interface{})

Verbose only prints if LogLevel is set to VERBOSE or lower in importance

func (*ParanoidLogger) Verbosef

func (l *ParanoidLogger) Verbosef(format string, v ...interface{})

Verbose only prints if LogLevel is set to VERBOSE or lower in importance

func (*ParanoidLogger) Warn

func (l *ParanoidLogger) Warn(v ...interface{})

Warn only prints if LogLevel is set to WARNING or lower in importance

func (*ParanoidLogger) Warnf

func (l *ParanoidLogger) Warnf(format string, v ...interface{})

Warn only prints if LogLevel is set to WARNING or lower in importance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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