debug

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: GPL-3.0 Imports: 10 Imported by: 3 modules, 2 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

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	bytes.Buffer
	Style string
}

Info gathers debugging information and stores everything in a buffer in order to write it to somewhere later. It directly inherits a bytes.Buffer, so you can also use all these functions too.

func (*Info) AddGoroutineStack

func (di *Info) AddGoroutineStack()

AddGoroutineStack adds the current goroutine stack.

func (*Info) AddLastReportedModuleError

func (di *Info) AddLastReportedModuleError()

AddLastReportedModuleError adds the last reported module error, if one exists.

func (*Info) AddLastUnexpectedLogs

func (di *Info) AddLastUnexpectedLogs()

AddLastUnexpectedLogs adds the last 10 unexpected log lines, if any.

func (*Info) AddPlatformInfo

func (di *Info) AddPlatformInfo(ctx context.Context)

AddPlatformInfo adds OS and platform information.

func (*Info) AddSection

func (di *Info) AddSection(name string, flags InfoFlag, content ...string)

AddSection adds a debug section to the Info. The result is directly written into the buffer.

func (*Info) AddVersionInfo

func (di *Info) AddVersionInfo()

AddVersionInfo adds version information from the info pkg.

type InfoFlag

type InfoFlag int

InfoFlag defines possible options for adding sections to a Info.

const (
	// NoFlags does nothing.
	NoFlags InfoFlag = 0

	// UseCodeSection wraps the section content in a markdown code section.
	UseCodeSection InfoFlag = 1

	// AddContentLineBreaks adds a line breaks after each line of content,
	// except for the last.
	AddContentLineBreaks InfoFlag = 2
)

Jump to

Keyboard shortcuts

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