logger

package
v0.1.0-preview.4.rc Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicLogger

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

func NewLogger

func NewLogger(verbose bool) *BasicLogger

func (*BasicLogger) Debug

func (l *BasicLogger) Debug(msg string, args ...any)

func (*BasicLogger) Error

func (l *BasicLogger) Error(msg string, args ...any)

func (*BasicLogger) Info

func (l *BasicLogger) Info(msg string, args ...any)

func (*BasicLogger) Title

func (l *BasicLogger) Title(msg string, args ...any)

func (*BasicLogger) Warn

func (l *BasicLogger) Warn(msg string, args ...any)

type LogEntry added in v0.0.9

type LogEntry struct {
	Level   string
	Message string
}

LogEntry represents a single log entry with level and message

type NoopLogger added in v0.0.9

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

NoopLogger implements the Logger interface but doesn't output anything. Instead, it buffers all log messages for testing assertions. It is safe for concurrent use.

func NewNoopLogger added in v0.0.9

func NewNoopLogger() *NoopLogger

NewNoopLogger creates a new no-op logger for testing

func (*NoopLogger) Clear added in v0.0.9

func (l *NoopLogger) Clear()

Clear removes all buffered entries

func (*NoopLogger) Contains added in v0.0.9

func (l *NoopLogger) Contains(text string) bool

Contains checks if any log entry contains the specified text

func (*NoopLogger) ContainsLevel added in v0.0.9

func (l *NoopLogger) ContainsLevel(level, text string) bool

ContainsLevel checks if any log entry with the specified level contains the text

func (*NoopLogger) Debug added in v0.0.9

func (l *NoopLogger) Debug(msg string, args ...any)

Debug implements the Logger interface - buffers debug messages

func (*NoopLogger) Error added in v0.0.9

func (l *NoopLogger) Error(msg string, args ...any)

Error implements the Logger interface - buffers error messages

func (*NoopLogger) GetEntries added in v0.0.9

func (l *NoopLogger) GetEntries() []LogEntry

GetEntries returns a copy of all buffered log entries

func (*NoopLogger) GetEntriesByLevel added in v0.0.9

func (l *NoopLogger) GetEntriesByLevel(level string) []LogEntry

GetEntriesByLevel returns all entries for a specific log level

func (*NoopLogger) GetMessages added in v0.0.9

func (l *NoopLogger) GetMessages() []string

GetMessages returns all buffered messages as strings

func (*NoopLogger) GetMessagesByLevel added in v0.0.9

func (l *NoopLogger) GetMessagesByLevel(level string) []string

GetMessagesByLevel returns all messages for a specific log level

func (*NoopLogger) Info added in v0.0.9

func (l *NoopLogger) Info(msg string, args ...any)

Info implements the Logger interface - buffers info messages

func (*NoopLogger) Len added in v0.0.9

func (l *NoopLogger) Len() int

Len returns the number of buffered entries

func (*NoopLogger) Title added in v0.0.9

func (l *NoopLogger) Title(msg string, args ...any)

Title implements the Logger interface - buffers title messages

func (*NoopLogger) Warn added in v0.0.9

func (l *NoopLogger) Warn(msg string, args ...any)

Warn implements the Logger interface - buffers warning messages

type NoopProgressTracker added in v0.0.9

type NoopProgressTracker struct{}

NoopProgressTracker is a progress tracker that does nothing (for testing)

func NewNoopProgressTracker added in v0.0.9

func NewNoopProgressTracker() *NoopProgressTracker

NewNoopProgressTracker creates a new no-op progress tracker

func (*NoopProgressTracker) Clear added in v0.0.9

func (n *NoopProgressTracker) Clear()

Clear does nothing

func (*NoopProgressTracker) ProgressRows added in v0.0.9

func (n *NoopProgressTracker) ProgressRows() []iface.ProgressRow

ProgressRows returns an empty slice

func (*NoopProgressTracker) Render added in v0.0.9

func (n *NoopProgressTracker) Render()

Render does nothing

func (*NoopProgressTracker) Set added in v0.0.9

func (n *NoopProgressTracker) Set(id string, pct int, label string)

Set does nothing

type ProgressLogger

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

func NewProgressLogger

func NewProgressLogger(base iface.Logger, tracker iface.ProgressTracker) *ProgressLogger

func (*ProgressLogger) ClearProgress

func (p *ProgressLogger) ClearProgress()

func (*ProgressLogger) Error

func (p *ProgressLogger) Error(msg string, args ...any)

func (*ProgressLogger) Info

func (p *ProgressLogger) Info(msg string, args ...any)

func (*ProgressLogger) PrintProgress

func (p *ProgressLogger) PrintProgress()

func (*ProgressLogger) ProgressRows

func (p *ProgressLogger) ProgressRows() []iface.ProgressRow

func (*ProgressLogger) SetProgress

func (p *ProgressLogger) SetProgress(name string, percent int, displayText string)

func (*ProgressLogger) Title

func (p *ProgressLogger) Title(msg string, args ...any)

func (*ProgressLogger) Warn

func (p *ProgressLogger) Warn(msg string, args ...any)

type ZapLogger

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

func NewZapLogger

func NewZapLogger(verbose bool) *ZapLogger

func (*ZapLogger) Debug

func (l *ZapLogger) Debug(msg string, args ...any)

func (*ZapLogger) Error

func (l *ZapLogger) Error(msg string, args ...any)

func (*ZapLogger) Info

func (l *ZapLogger) Info(msg string, args ...any)

func (*ZapLogger) Title

func (l *ZapLogger) Title(msg string, args ...any)

func (*ZapLogger) Warn

func (l *ZapLogger) Warn(msg string, args ...any)

Jump to

Keyboard shortcuts

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