logger

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorBold   = "\033[1m"
	ColorDim    = "\033[2m"
	ColorRed    = "\033[31m"
	ColorGreen  = "\033[32m"
	ColorYellow = "\033[33m"
	ColorCyan   = "\033[36m"
	ColorReset  = "\033[0m"
)

Variables

View Source
var Writer io.Writer

Writer is the global destination for debug logs. If nil, no debug output is produced.

Functions

func Debugf

func Debugf(format string, args ...any)

Debugf formats and writes a message to the debug Writer if it is non-nil.

func IsDebug

func IsDebug() bool

IsDebug returns true if debug logging is enabled.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger allows component-specific prefixing for debug messages.

func New

func New(component, color string) *Logger

New returns a Logger with the specified component name and color.

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...any)

Debugf formats and prints a debug message if the global logger.Writer is set.

Jump to

Keyboard shortcuts

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