debug

package
v1.15.13 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 11 Imported by: 12

Documentation

Overview

Package debug provides logging of debug information.

This package is heavily based on github.com/restic/restic/internal/debug

Index

Constants

This section is empty.

Variables

View Source
var (
	// Stdout is exported for tests.
	Stdout io.Writer = os.Stdout
	// Stderr is exported for tests.
	Stderr io.Writer = os.Stderr
	// LogWriter is exposed for consuming extra command output, if needed.
	LogWriter io.Writer = io.Discard
)

Functions

func IsEnabled

func IsEnabled() bool

IsEnabled returns true if debug logging was enabled.

func Log

func Log(f string, args ...any)

Log logs a statement to Stderr (unless filtered) and the debug log file (if enabled).

func LogN added in v1.12.5

func LogN(offset int, f string, args ...any)

LogN logs a statement to Stderr (unless filtered) and the debug log file (if enabled). The offset will be applied to the runtime position.

func ModuleVersion added in v1.14.0

func ModuleVersion(m string) semver.Version

ModuleVersion the version of the named import.

func V added in v1.15.13

func V(n int) v

V returns a logger at the given verbosity level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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