Documentation
¶
Index ¶
- type Context
- type Logger
- type NoopLogger
- func (nl *NoopLogger) Debugf(format string, args ...any)
- func (nl *NoopLogger) Logf(format string, args ...any)
- func (nl *NoopLogger) SetArticleCount(total, processed int)
- func (nl *NoopLogger) SetStage(stage string)
- func (nl *NoopLogger) SetSubStage(status string)
- func (nl *NoopLogger) SetTokenEstimate(total, used int)
- func (nl *NoopLogger) StartWaiting()
- func (nl *NoopLogger) Warningf(format string, args ...any)
- type Progress
- type SimpleLogger
- func (sl *SimpleLogger) Debugf(format string, args ...any)
- func (sl *SimpleLogger) Logf(format string, args ...any)
- func (sl *SimpleLogger) SetArticleCount(total, processed int)
- func (sl *SimpleLogger) SetStage(stage string)
- func (sl *SimpleLogger) SetSubStage(stage string)
- func (sl *SimpleLogger) SetTokenEstimate(total, used int)
- func (sl *SimpleLogger) StartWaiting()
- func (sl *SimpleLogger) Warningf(format string, args ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context wraps a Logger and guards against nil receiver.
func NewContext ¶
NewContext wraps a Logger. Passing nil produces a no-op context.
type Logger ¶
type Logger interface {
Logf(format string, args ...any)
Warningf(format string, args ...any)
Debugf(format string, args ...any)
}
Logger is the minimal interface for progress and verbose logging implementations.
type NoopLogger ¶
type NoopLogger struct{}
NoopLogger discards all output. Used as the default when no progress is desired.
func (*NoopLogger) Debugf ¶
func (nl *NoopLogger) Debugf(format string, args ...any)
func (*NoopLogger) Logf ¶
func (nl *NoopLogger) Logf(format string, args ...any)
func (*NoopLogger) SetArticleCount ¶
func (nl *NoopLogger) SetArticleCount(total, processed int)
func (*NoopLogger) SetStage ¶
func (nl *NoopLogger) SetStage(stage string)
func (*NoopLogger) SetSubStage ¶
func (nl *NoopLogger) SetSubStage(status string)
func (*NoopLogger) SetTokenEstimate ¶
func (nl *NoopLogger) SetTokenEstimate(total, used int)
func (*NoopLogger) StartWaiting ¶
func (nl *NoopLogger) StartWaiting()
func (*NoopLogger) Warningf ¶
func (nl *NoopLogger) Warningf(format string, args ...any)
type Progress ¶
type Progress interface {
Logger
SetStage(stage string)
SetSubStage(status string)
SetArticleCount(total, processed int)
SetTokenEstimate(total, used int)
StartWaiting()
}
Progress extends Logger with stage/count/timing reporting. Implementations: NoopLogger (no output), SimpleLogger (stdout), TUIProgress (tea messages).
type SimpleLogger ¶
type SimpleLogger struct {
// contains filtered or unexported fields
}
SimpleLogger writes formatted output to an io.Writer.
func NewSimpleLogger ¶
func NewSimpleLogger(writer io.Writer, debug bool) *SimpleLogger
NewSimpleLogger creates a SimpleLogger; set debug=true to enable Debugf output.
func (*SimpleLogger) Debugf ¶
func (sl *SimpleLogger) Debugf(format string, args ...any)
func (*SimpleLogger) Logf ¶
func (sl *SimpleLogger) Logf(format string, args ...any)
func (*SimpleLogger) SetArticleCount ¶
func (sl *SimpleLogger) SetArticleCount(total, processed int)
func (*SimpleLogger) SetStage ¶
func (sl *SimpleLogger) SetStage(stage string)
func (*SimpleLogger) SetSubStage ¶
func (sl *SimpleLogger) SetSubStage(stage string)
func (*SimpleLogger) SetTokenEstimate ¶
func (sl *SimpleLogger) SetTokenEstimate(total, used int)
func (*SimpleLogger) StartWaiting ¶
func (sl *SimpleLogger) StartWaiting()
func (*SimpleLogger) Warningf ¶
func (sl *SimpleLogger) Warningf(format string, args ...any)
Click to show internal directories.
Click to hide internal directories.