output

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Red    = "\033[31m"
	Green  = "\033[32m"
	Yellow = "\033[33m"
	Blue   = "\033[34m"
	Gray   = "\033[90m"
)

Color codes for terminal output

Variables

This section is empty.

Functions

This section is empty.

Types

type Colorizer

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

Colorizer handles color output

func NewColorizer

func NewColorizer(colorSetting string) *Colorizer

NewColorizer creates a new colorizer based on the color setting

func (*Colorizer) Blue

func (c *Colorizer) Blue(text string) string

Blue returns text in blue

func (*Colorizer) Color

func (c *Colorizer) Color(text, colorCode string) string

Color wraps text with ANSI color codes if enabled

func (*Colorizer) GetColorSetting added in v1.0.0

func (c *Colorizer) GetColorSetting() string

GetColorSetting returns the color setting string

func (*Colorizer) Gray

func (c *Colorizer) Gray(text string) string

Gray returns text in gray

func (*Colorizer) Green

func (c *Colorizer) Green(text string) string

Green returns text in green

func (*Colorizer) IsEnabled

func (c *Colorizer) IsEnabled() bool

IsEnabled returns whether coloring is enabled

func (*Colorizer) Red

func (c *Colorizer) Red(text string) string

Red returns text in red

func (*Colorizer) Yellow

func (c *Colorizer) Yellow(text string) string

Yellow returns text in yellow

type DebugLogger added in v1.0.0

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

DebugLogger handles debug output with categories

func NewDebugLogger added in v1.0.0

func NewDebugLogger(colorSetting string, writer io.Writer) *DebugLogger

NewDebugLogger creates a new debug logger

func (*DebugLogger) Log added in v1.0.0

func (d *DebugLogger) Log(category, message string)

Log logs a debug message with a category Categories: CONFIG, DISCOVER, DETECT, API, GITLAB, VALIDATE

func (*DebugLogger) LogAPIRequest added in v1.0.0

func (d *DebugLogger) LogAPIRequest(endpoint, method string, hasProject bool, project string)

LogAPIRequest logs an API request with details

func (*DebugLogger) LogConfig added in v1.0.0

func (d *DebugLogger) LogConfig(key, value string)

LogConfig logs configuration loading

func (*DebugLogger) LogDiscovery added in v1.0.0

func (d *DebugLogger) LogDiscovery(message string)

LogDiscovery logs file discovery

func (*DebugLogger) LogGitLab added in v1.0.0

func (d *DebugLogger) LogGitLab(message string)

LogGitLab logs GitLab client operations

func (*DebugLogger) LogProjectDetection added in v1.0.0

func (d *DebugLogger) LogProjectDetection(source, project, filePath string)

LogProjectDetection logs project detection results

func (*DebugLogger) LogSection added in v1.0.0

func (d *DebugLogger) LogSection(title string)

LogSection logs a section header for grouping debug output

func (*DebugLogger) LogValidate added in v1.0.0

func (d *DebugLogger) LogValidate(message string)

LogValidate logs validation operations

type Formatter

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

Formatter handles output formatting

func NewFormatter

func NewFormatter(colorSetting string, verbose bool) *Formatter

NewFormatter creates a new output formatter

func NewFormatterWithDebug added in v1.0.0

func NewFormatterWithDebug(colorSetting string, verbose bool, debugWriter io.Writer) *Formatter

NewFormatterWithDebug creates a new output formatter with debug logging enabled

func (*Formatter) FormatMessage

func (f *Formatter) FormatMessage(w io.Writer, level, message string)

FormatMessage formats a generic message

func (*Formatter) FormatResult

func (f *Formatter) FormatResult(w io.Writer, format string, results []validator.Result, filename string)

FormatResult formats and writes validation results to the output

func (*Formatter) FormatSummary added in v0.2.0

func (f *Formatter) FormatSummary(w io.Writer, format string, results []validator.FileResult)

FormatSummary formats and writes a summary of batch validation results

func (*Formatter) GetDebugLogger added in v1.0.0

func (f *Formatter) GetDebugLogger() *DebugLogger

GetDebugLogger returns the debug logger (may be nil if debug disabled)

func (*Formatter) SetDebug added in v1.0.0

func (f *Formatter) SetDebug(enabled bool, writer io.Writer)

SetDebug enables or disables debug logging

Jump to

Keyboard shortcuts

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