progress

package
v1.11.3 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 5 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

This section is empty.

Functions

This section is empty.

Types

type Level added in v1.11.0

type Level int

Level controls which messages a Logger emits. Higher values are more verbose.

const (

	// LevelError emits only errors.
	LevelError Level
	// LevelWarn emits errors and warnings.
	LevelWarn
	// LevelInfo emits errors, warnings, and progress/step messages. Default.
	LevelInfo
	// LevelDebug emits everything including detailed diagnostic logs.
	LevelDebug
)

func ParseLevel added in v1.11.0

func ParseLevel(s string) (Level, bool)

ParseLevel parses a case-insensitive level string ("error", "warn", "info", "debug"). Returns false if the string is unrecognised.

func (Level) String added in v1.11.0

func (l Level) String() string

String returns the canonical lowercase name of the level.

type Logger

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

Logger handles leveled output to stderr. Logging format:

2006-01-02 15:04:05 [scanning] message   — progress (info+)
2006-01-02 15:04:05 [warning] message    — warnings (warn+)
2006-01-02 15:04:05 [error] message      — errors (error+)
2006-01-02 15:04:05 [debug] message      — diagnostics (debug only)
⠋ label... (Xms)                         — spinner animation (info+)
✓ label (Xms)                            — step done (info+)
○ label (skipped)                        — step skipped (info+)

func NewLogger

func NewLogger(level Level) *Logger

NewLogger creates a Logger that emits messages at or below the given level.

func NewNoop

func NewNoop() *Logger

NewNoop returns a Logger that suppresses all output, including errors.

func (*Logger) Debug added in v1.11.0

func (l *Logger) Debug(format string, args ...any)

Debug prints a diagnostic message to stderr when level >= debug. Format: [debug] message

func (*Logger) Error

func (l *Logger) Error(format string, args ...any)

Error prints an error to stderr when level >= error (i.e. unless noop). Format: [error] message

func (*Logger) Level added in v1.11.0

func (l *Logger) Level() Level

Level returns the logger's current level.

func (*Logger) Progress

func (l *Logger) Progress(format string, args ...any)

Progress prints a progress message to stderr when level >= info. Format: [scanning] message

func (*Logger) StepDone

func (l *Logger) StepDone(elapsed time.Duration)

StepDone completes the current step, showing elapsed time.

func (*Logger) StepSkip

func (l *Logger) StepSkip(reason string)

StepSkip marks the current step as skipped.

func (*Logger) StepStart

func (l *Logger) StepStart(label string)

StepStart begins a labeled progress step with a spinner.

func (*Logger) Warn added in v1.10.1

func (l *Logger) Warn(format string, args ...any)

Warn prints a warning to stderr when level >= warn.

Directories

Path Synopsis
Package filelog tees the agent's stderr stream to a file on disk so that when agent-api is unreachable (network failure, firewall, expired credentials), the customer can be asked to share the local log file with support.
Package filelog tees the agent's stderr stream to a file on disk so that when agent-api is unreachable (network failure, firewall, expired credentials), the customer can be asked to share the local log file with support.

Jump to

Keyboard shortcuts

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