logger

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(format string, args ...interface{})

Debug logs a debug message (only shown with --debug flag)

func Error

func Error(format string, args ...interface{})

Error logs an error message (always shown)

func Info

func Info(format string, args ...interface{})

Info logs an info message (shown in normal mode)

func IsDebug

func IsDebug() bool

IsDebug returns true if debug mode is enabled

func SetLevel

func SetLevel(level Level)

SetLevel sets the global logging level

func SetOutput

func SetOutput(stdout, stderr io.Writer)

SetOutput sets the output writers

func SetupComplete

func SetupComplete()

SetupComplete prints the completion message after setup

func StopSpinner

func StopSpinner(handle *SpinnerHandle)

StopSpinner stops the spinner and waits for it to finish

func Summary

func Summary(total, passed, failed int)

Summary logs the test summary

func TestFailed

func TestFailed(name string, err error)

TestFailed prints the test failure with details

func TestPassed

func TestPassed()

TestPassed prints a simple success message

func TestRunning

func TestRunning(current, total int, name string)

TestRunning prints the test header without spinner

Types

type Level

type Level int

Level represents the logging level

const (
	// ErrorLevel only shows errors
	ErrorLevel Level = iota
	// InfoLevel shows info messages and errors (normal mode)
	InfoLevel
	// DebugLevel shows all messages including debug
	DebugLevel
)

type SpinnerHandle

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

SpinnerHandle represents a running spinner

func ShowSpinner

func ShowSpinner(message string) *SpinnerHandle

ShowSpinner displays an animated spinner with a message Returns a handle that can be used to stop the spinner

func TestingMessage

func TestingMessage() *SpinnerHandle

TestingMessage prints the "Testing..." message with spinner start

Jump to

Keyboard shortcuts

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