diag

package
v0.0.0-...-a6598b8 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "No version specified"

Set from Makefile

Functions

func Run

func Run(ps *pubsub.PubSub, loggerArg *logrus.Logger, logArg *base.LogObject, arguments []string) int

Types

type PrintHandle

type PrintHandle struct {
	// contains filtered or unexported fields
}

PrintHandle is returned by PrintIfSpaceInit() The assumption is that the caller calls Flush() when done with one set of output so it can be written to a file and the counters reset.

func PrintIfSpaceInit

func PrintIfSpaceInit(outfile *os.File, stateFilename string,
	maxRows int, maxColumns int) *PrintHandle

PrintIfSpaceInit sets up the limits and initializes current lines to zero

func (*PrintHandle) Flush

func (h *PrintHandle) Flush()

Flush writes all the output to statefilename and resets to zero. It prints a line if exceeded

func (*PrintHandle) Print

func (h *PrintHandle) Print(format string, a ...any) (bool, error)

Print checks the number of lines since last PrintIfSpaceInit taking into account the number of columns. A terminating non-empty line counts as a line. Returns true if it was printed. In addition it always saves to allBytes

func (*PrintHandle) Reset

func (h *PrintHandle) Reset()

Reset forgets about what has been printed

Jump to

Keyboard shortcuts

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