log

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package log provides a project-level charmbracelet/log logger for spin.

It is intended for diagnostic, warning, and error messages — not for styled user-facing success/info output, which remains in cmd/print.go. The default logger writes to stderr with colors enabled, no timestamps, and the info level.

Index

Constants

This section is empty.

Variables

View Source
var Logger = log.NewWithOptions(os.Stderr, log.Options{
	Level:           log.InfoLevel,
	ReportTimestamp: false,
})

Logger is the package-level logger used by spin. It writes to stderr and is intended for warnings, errors, and diagnostic output. Callers should prefer the Info/Warn/Error/Debug/Print helpers below.

View Source
var Stdout = log.NewWithOptions(os.Stdout, log.Options{
	Level:           log.InfoLevel,
	ReportTimestamp: false,
})

Stdout is a secondary logger for user-facing informational output that should appear on stdout (e.g. success messages). It shares the same timestamp/level settings as Logger.

Functions

func Debug

func Debug(msg string, args ...any)

Debug logs a debug-level message to stderr.

func Error

func Error(msg string, args ...any)

Error logs an error-level message to stderr.

func Fatal

func Fatal(msg string, args ...any)

Fatal logs an error-level message to stderr and exits.

func Info

func Info(msg string, args ...any)

Info logs an info-level message to stderr.

func Print

func Print(msg string, args ...any)

Print logs a message without a level prefix to stderr.

func SetLevel

func SetLevel(l log.Level)

SetLevel changes the current logging level for both loggers.

func Warn

func Warn(msg string, args ...any)

Warn logs a warning-level message to stderr.

Types

This section is empty.

Jump to

Keyboard shortcuts

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