Documentation
¶
Overview ¶
Package logging is part of the GoFastr harness.
See docs/harness-architecture.md § Logging.
Package logging implements the harness's own operational logs (distinct from the per-session event log in package session).
Per § Logging:
- Structured JSON, one object per line.
- Daily-rotated files at ~/.local/state/gofastr/harness/log/harness-YYYYMMDD.log.
- Components: engine, multiplex, provider.<name>, transport.<name>, mcpclient, mcpserver, skill, hook, auth.
- Per-component level via --log-level engine=debug,provider.copilot=trace.
Index ¶
- type DailyFileWriter
- type Level
- type Logger
- func (l *Logger) ApplyOverrides(spec string) error
- func (l *Logger) Debug(msg string, kv ...any)
- func (l *Logger) Error(msg string, kv ...any)
- func (l *Logger) Info(msg string, kv ...any)
- func (l *Logger) Log(level Level, msg string, fields map[string]any)
- func (l *Logger) SetComponentLevel(component string, level Level)
- func (l *Logger) Trace(msg string, kv ...any)
- func (l *Logger) Warn(msg string, kv ...any)
- func (l *Logger) WithComponent(component string) *Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DailyFileWriter ¶
type DailyFileWriter struct {
// contains filtered or unexported fields
}
DailyFileWriter writes to a per-day file at the given directory, rotating at UTC midnight.
func NewDailyFileWriter ¶
func NewDailyFileWriter(dir string) (*DailyFileWriter, error)
NewDailyFileWriter returns a writer that opens `<dir>/harness-YYYYMMDD.log` and rotates on day change.
func (*DailyFileWriter) Close ¶
func (w *DailyFileWriter) Close() error
Close closes the underlying file.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger writes structured JSON log lines.
func (*Logger) ApplyOverrides ¶
ApplyOverrides parses a string like "engine=debug,provider.openrouter=trace" and updates component levels accordingly.
func (*Logger) Log ¶
Log writes one structured record. Use Trace/Debug/Info/Warn/Error helpers for level-tagged shortcuts.
func (*Logger) SetComponentLevel ¶
SetComponentLevel overrides the level for one component.
func (*Logger) WithComponent ¶
WithComponent returns a child Logger tagged with the given component name. Component levels override the default.