log

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ELNone completely turns off logging
	ELNone = 0
	// ELFatal sets logging to print messages of fatal events, which surely lead to a crash
	ELFatal = 1
	// ELError sets logging to print error messages, which may lead to a crash
	ELError = 2
	// ELInfo sets logging to print informational messages about the progress of tasks
	ELInfo = 3
	// ELDebug logs verbose debug messages
	ELDebug = 4
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EmersyxLogger

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

EmersyxLogger is an implementation of a logger based on the standard log.Logger type. The EmersyxLogger implementation offers additional logging functionality

func NewEmersyxLogger

func NewEmersyxLogger(writer io.Writer, componentID string, level uint) (*EmersyxLogger, error)

NewEmersyxLogger returns an EmersyxLogger instance with the default format, which writes messages to specified io.Writer instance. The componentID argument is used to help differentiate between logs of different emersyx components. The level argument controls the verbosity.

func (EmersyxLogger) Debug

func (el EmersyxLogger) Debug(v ...interface{})

Debug calls the print method with the ELDebug level and the given arguments.

func (EmersyxLogger) Debugf

func (el EmersyxLogger) Debugf(format string, v ...interface{})

Debugf calls the printf method with the ELDebug level and the given arguments.

func (EmersyxLogger) Debugln

func (el EmersyxLogger) Debugln(v ...interface{})

Debugln calls the println method with the ELDebug level and the given arguments.

func (EmersyxLogger) Error

func (el EmersyxLogger) Error(v ...interface{})

Error calls the print method with the ELError level and the given arguments.

func (EmersyxLogger) Errorf

func (el EmersyxLogger) Errorf(format string, v ...interface{})

Errorf calls the printf method with the ELError level and the given arguments.

func (EmersyxLogger) Errorln

func (el EmersyxLogger) Errorln(v ...interface{})

Errorln calls the println method with the ELError level and the given arguments.

func (EmersyxLogger) Fatal

func (el EmersyxLogger) Fatal(v ...interface{})

Fatal calls the print method with the ELFatal level and the given arguments. After the logging message gets printed, the os.Exit(1) function is called.

func (EmersyxLogger) Fatalf

func (el EmersyxLogger) Fatalf(format string, v ...interface{})

Fatalf calls the printf method with the ELFatal level and the given arguments. After the logging message gets printed, the os.Exit(1) function is called.

func (EmersyxLogger) Fatalln

func (el EmersyxLogger) Fatalln(v ...interface{})

Fatalln calls the println method with the ELFatal level and the given arguments. After the logging message gets printed, the os.Exit(1) function is called.

func (EmersyxLogger) Info

func (el EmersyxLogger) Info(v ...interface{})

Info calls the print method with the ELInfo level and the given arguments.

func (EmersyxLogger) Infof

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

Infof calls the printf method with the ELInfo level and the given arguments.

func (EmersyxLogger) Infoln

func (el EmersyxLogger) Infoln(v ...interface{})

Infoln calls the println method with the ELInfo level and the given arguments.

func (*EmersyxLogger) SetComponentID

func (el *EmersyxLogger) SetComponentID(componentID string) error

SetComponentID sets the identifier of the component which makes use of the EmersyxLogger instance.

func (*EmersyxLogger) SetLevel

func (el *EmersyxLogger) SetLevel(level uint)

SetLevel sets the logging verbosity level for the EmersyxLogger instance.

func (*EmersyxLogger) SetOutput

func (el *EmersyxLogger) SetOutput(writer io.Writer) error

SetOutput sets the io.Writer instance where logging messages are written to.

Jump to

Keyboard shortcuts

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