logging

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Trace   *log.Logger
	Debug   *log.Logger
	Warning *log.Logger
)

Available loggers

Functions

func IfTracing

func IfTracing(f func(l *log.Logger))

IfTracing will call the given function with Trace logger if current logging level is to enable traces Allows to create time-consuming traces only when they are traced.

func SetLogLevel

func SetLogLevel(lvl Level)

SetLogLevel sets the current logging level to given one

Types

type Level

type Level int

Level is the type for logging level

const (
	TRACE Level = iota
	DEBUG
	WARNING
	DISABLED
)

Available logging levels

const DefaultLoggingLevel Level = WARNING

DefaultLoggingLevel is the logging level we start with

func GetLogLevel

func GetLogLevel() Level

GetLogLevel returns current log level

Jump to

Keyboard shortcuts

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