logging

package
v0.0.0-...-db20e75 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = &Logger{}

Log variable initialises Top level logging object

Functions

This section is empty.

Types

type Logger

type Logger struct {
	Log       *logrus.Logger
	Verbosity int
}

Logger struct used to set log level across packages

func (*Logger) Error

func (logger *Logger) Error(err error, error string)

Error outputs error with err object

func (*Logger) Fatal

func (logger *Logger) Fatal(err error, fatal string)

Fatal outputs error and os.Exits(1)

func (*Logger) GetLogger

func (logger *Logger) GetLogger() *logrus.Logger

GetLogger gets the logger object

func (*Logger) Info

func (logger *Logger) Info(field, value, info string)

Info outputs info log with single field and value

func (*Logger) InfoWithFields

func (logger *Logger) InfoWithFields(fields map[string]interface{}, info string)

InfoWithFields outputs info log with multiple field and values

func (*Logger) SetVerbosity

func (logger *Logger) SetVerbosity(verbosity int)

SetVerbosity sets the verbosity level of the logging tool

func (*Logger) Warn

func (logger *Logger) Warn(field, value, warn string)

Warn outputs warning with single field and value

func (*Logger) WarnWithFields

func (logger *Logger) WarnWithFields(fields map[string]interface{}, warn string)

WarnWithFields outputs warning log with multiple field and values

Jump to

Keyboard shortcuts

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