debug

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DebugServiceCmd = &bonzai.Cmd{
	Name:    `debug`,
	Alias:   `d`,
	Short:   `enable debug information output`,
	Usage:   `[OUTPUT]`,
	MinArgs: 0,
	MaxArgs: 1,
	Long: `
The debug command enables debug information output for AutoPDF operations.
This provides detailed diagnostic information useful for troubleshooting.

Output options:
  stdout - Output debug info to standard output (default)
  stderr - Output debug info to standard error
  file   - Output debug info to a log file
  both   - Output debug info to both stdout and file

Examples:
  autopdf debug
  autopdf debug stdout
  autopdf debug file
  autopdf debug both
`,
	Comp: comp.Cmds,
	Cmds: []*bonzai.Cmd{
		help.Cmd,
	},
	Do: func(cmd *bonzai.Cmd, args ...string) error {
		log.Println("Enabling debug information output...")

		output := "stdout"
		if len(args) > 0 {
			output = args[0]
		}

		validOutputs := map[string]bool{
			"stdout": true,
			"stderr": true,
			"file":   true,
			"both":   true,
		}
		if !validOutputs[output] {
			return fmt.Errorf("invalid debug output '%s': must be one of stdout, stderr, file, both", output)
		}

		serviceBuilder := wiring.NewServiceBuilder()
		debugService := serviceBuilder.BuildDebugService(output)

		result, err := debugService.EnableDebug()
		if err != nil {
			log.Printf("Error enabling debug: %s", err)
			return err
		}

		resultHandler := resultPkg.NewResultHandler()
		return resultHandler.HandleDebugResult(result)
	},
}

DebugServiceCmd is the debug command that enables debug information output

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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