rumble

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Debug   LogLevel = "Debug"
	Info             = "Info"
	Warning          = "Warning"
	Error            = "Error"
	Fatal            = "Fatal"
)

Log levels

Variables

View Source
var LogLevelPriority = map[string]int{
	fmt.Sprint(Debug):   1,
	fmt.Sprint(Info):    2,
	fmt.Sprint(Warning): 3,
	fmt.Sprint(Error):   4,
	fmt.Sprint(Fatal):   5,
}

LogLevelPriority is a map assigning priorities to log level (lower number means a higher priority)

View Source
var StringToLoglevel = map[string]LogLevel{
	fmt.Sprint(Debug):   Debug,
	fmt.Sprint(Info):    Info,
	fmt.Sprint(Warning): Warning,
	fmt.Sprint(Error):   Error,
	fmt.Sprint(Fatal):   Fatal,
}

StringToLoglevel is a map assigning log levels to strings.

Functions

func DeregisterLogListener

func DeregisterLogListener(name string)

DeregisterLogListener deregisters an existing log listener.

func EvalToString

func EvalToString(v interface{}) string

EvalToString should be used if an eval result should be converted into a string.

func Log

func Log(processorID uint64, rootMonitorID uint64, level LogLevel, v ...interface{})

Log logs a message

func LogLevelMatch

func LogLevelMatch(l1, l2 interface{}) bool

LogLevelMatch checks if the first logging level is equal or a sublevel of the second one.

func RegisterLogListener

func RegisterLogListener(name string, listener LogFunc)

RegisterLogListener registers a new log listener

Types

type LogFunc

type LogFunc func(processorID uint64, rootMonitorID uint64, level LogLevel, v ...interface{})

LogFunc is used to handle log messages - a processor and monitor id of 0 indicates a global log message

type LogLevel

type LogLevel string

LogLevel represents a logging level

Directories

Path Synopsis
Package api contains functions for external code which wants to integrate with Brawler.
Package api contains functions for external code which wants to integrate with Brawler.
Package parser contains the Rumble parser.
Package parser contains the Rumble parser.
stdlib
util
Package util contains optional utility functions for Rumble.
Package util contains optional utility functions for Rumble.

Jump to

Keyboard shortcuts

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