API Reference (Summary)
This page summarizes the main public classes and methods. For full details, see JSDoc hovers or TypeDoc output.
Node Entry (spectrallogs)
Class
SpectralLoggerconfigure(options)— update configuration at runtimeuse(plugin)— register a pluginlog/info/success/warn/error/debug(message, color?, codec?)flush()— force flush buffered outputgetConfig()— resolved configgetErrorStats()/clearErrorCache()
Plugins
FileLoggerPlugin(options?)— writes to file with rotationPerformanceTrackerPlugin()— measures logging durations
Types (from
src/types.d.ts)LogLevel,SpectralConfigOptions,LogOptions,Plugin,ColorInput
Web Entry (spectrallogs/web)
Class
SpectralLoggerWebconfigure(options)— update configurationuse(plugin)— register a web pluginlog/info/success/warn/error/debug(message, color?)flush()getConfig()— resolved configgetErrorStats()/clearErrorCache()
Web Output
- Batching options via
new SpectralLoggerWeb({ batching, maxBatchSize, maxLatencyMs, sink })
- Batching options via
Plugins
PerformanceTrackerWeb()— measures durations usingperformance.now()
Notes
- Node build uses ANSI colors and stdout/stderr buffering.
- Web build uses CSS colors and console/DOM sinks with batching.
