logging

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: GPL-3.0 Imports: 2 Imported by: 2

README

Logging package

Documentation

Index

Constants

View Source
const (
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DEBUG = 0
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	INFO = 1
	// WarnLevel level. Non-critical entries that deserve eyes.
	WARN = 2
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ERROR = 3
	// FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FATAL = 4
)

Variables

View Source
var (
	Verbose bool              = false
	Logger  []LoggerInterface = []LoggerInterface{&console.Logger{}}
	Log                       = &LogInstance{}
)

Functions

func Debug

func Debug(debug interface{})

func DebugWithData added in v0.0.6

func DebugWithData(debug interface{}, data interface{})

func Debugf

func Debugf(form string, vars ...interface{})

func Error

func Error(err interface{})

The useual defines

func ErrorWithData added in v0.0.6

func ErrorWithData(err interface{}, data interface{})

func Errorf

func Errorf(form string, vars ...interface{})

func Fatal

func Fatal(fatal interface{})

func FatalWithData added in v0.0.6

func FatalWithData(fatal interface{}, data interface{})

func Fatalf

func Fatalf(form string, vars ...interface{})

func Info

func Info(info interface{})

func InfoWithData added in v0.0.6

func InfoWithData(info interface{}, data interface{})

func Infof

func Infof(form string, vars ...interface{})

func Warn

func Warn(warn interface{})

func WarnWithData added in v0.0.6

func WarnWithData(warn interface{}, data interface{})

func Warnf

func Warnf(form string, vars ...interface{})

Types

type Level

type Level uint32

type LogInstance added in v0.0.6

type LogInstance struct {
	Loggers []LoggerInterface
}

func (*LogInstance) LogRunner added in v0.0.6

func (l *LogInstance) LogRunner(i interface{}, m interface{}, u uint32, b bool)

type LoggerInterface

type LoggerInterface interface {
	// Log(data, key=value fields, log level, Verbose (Debug))
	Log(interface{}, interface{}, uint32, bool)
}

The logger interface implements a single function to handle the desired response for the output

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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