trace

package
v6.0.0-alpha.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 3

Documentation

Overview

Package trace provides tracing utilities for debugging go-git operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogger

func SetLogger(l *log.Logger)

SetLogger sets the logger to use for tracing.

func SetTarget

func SetTarget(target Target)

SetTarget sets the tracing targets.

Types

type Target

type Target int32

Target is a tracing target.

const (
	// General traces general operations.
	General Target = 1 << iota

	// Packet traces git packets.
	Packet

	// SSH traces SSH handshake operations. This does not have
	// a direct translation to an upstream trace option.
	SSH

	// Performance traces performance of go-git components.
	Performance

	// HTTP traces HTTP operations and requests.
	HTTP

	// Internal traces internal go-git operations for debugging.
	Internal
)

func GetTarget

func GetTarget() Target

GetTarget returns the current tracing target.

func (Target) Enabled

func (t Target) Enabled() bool

Enabled returns true if the target is enabled.

func (Target) Print

func (t Target) Print(args ...any)

Print prints the given message only if the target is enabled.

func (Target) Printf

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

Printf prints the given message only if the target is enabled.

Jump to

Keyboard shortcuts

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