logging

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 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{}}
)

Functions

func Debug

func Debug(debug interface{})

func Debugf

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

func Error

func Error(err interface{})

The useual defines

func Errorf

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

func Fatal

func Fatal(fatal interface{})

func Fatalf

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

func Info

func Info(info interface{})

func Infof

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

func LogRunner

func LogRunner(i interface{}, m map[string]interface{}, u uint32, b bool)

func Warn

func Warn(warn interface{})

func Warnf

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

Types

type Level

type Level uint32

type LoggerInterface

type LoggerInterface interface {
	// Log(data, key=value fields, log level, Verbose (Debug))
	Log(interface{}, map[string]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