debug

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLogLines = 1000

MaxLogLines is the maximum number of lines to read from log file

Variables

View Source
var (
	// LogBuffer stores recent log entries in memory
	LogBuffer = newRingBuffer(1000)

	// Logger is the global debug logger
	Logger *log.Logger

	// Enabled indicates if debug mode is active
	Enabled bool

	// LogFilePath is the path to the log file (if set via --log)
	LogFilePath string
)

Functions

func ClearLogs

func ClearLogs()

ClearLogs clears the log buffer

func Disable

func Disable()

Disable turns off debug logging to stderr (still logs to buffer)

func Enable

func Enable()

Enable turns on debug logging to stderr

func GetLogs

func GetLogs() []string

GetLogs returns all log entries from the buffer

func HasLogFile

func HasLogFile() bool

HasLogFile returns true if logging to a file

func PrettyJSON

func PrettyJSON(data []byte) string

PrettyJSON formats JSON bytes for readable logging

func ReadLogFile

func ReadLogFile() (string, error)

ReadLogFile reads the last MaxLogLines lines from the log file

func SetLogFile

func SetLogFile(path string) error

SetLogFile writes logs to a file in addition to buffer

Types

This section is empty.

Jump to

Keyboard shortcuts

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