debuglog

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package debuglog is the git-remote-entire helper's shared debug logger.

Output is gated on ENTIRE_DEBUG: when unset, Printf is a no-op (and Enabled returns false so callers can skip work that only matters for a debug trace, e.g. dumping HTTP request bodies).

The prefix is fixed because the binary that uses these internals is also fixed — the package lives under internal/, so its callers are known.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enabled

func Enabled() bool

Enabled reports whether debug output is on. Callers should gate any expensive preparation (request dumps, body buffering) behind this.

func Printf

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

Printf writes a line to stderr (or the configured sink) when Enabled, prefixed with [git-remote-entire]. A trailing newline is appended.

func SetOutput

func SetOutput(w io.Writer) io.Writer

SetOutput redirects debug output. Returns the previous writer so tests can restore it. Pass nil to discard.

Types

This section is empty.

Jump to

Keyboard shortcuts

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