log library
Logging to the console and over HTTP.
Classes
- ConsoleSink
- ANSI-colored single-line output to stderr (or a custom writer).
- DeveloperSink
-
Forwards to
dart:developer.log. Silent in release on non-web (VM service not attached); active on web where it routes to the browser console. - HttpSink
-
Sends batched JSON records to an HTTP endpoint that accepts
POST <endpoint>/logwithContent-Type: application/jsonand anAuthorization: Bearer <token>header. Seetools/log_serverfor the reference receiver. - Log
- Global entry point for logging.
- Logger
- Scoped logger. Obtain via Log.tag.
- LogRecord
- A single log event passed to LogSink.emit.
- LogSink
- Destination for emitted records. Implementations must not throw; they swallow their own errors so one failing sink cannot take down the pipeline.
- MemorySink
- In-memory ring buffer. Useful as breadcrumbs for a crash reporter or as a deterministic sink in tests.
- NoopSink
- Discards everything. Default until Log.configure is called.
Enums
- LogLevel
-
Severity. Numeric values align with
package:loggingso DevTools filters map 1:1.