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>/log with Content-Type: application/json and an Authorization: Bearer <token> header. See tools/log_server for 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:logging so DevTools filters map 1:1.

Typedefs

HttpSender = Future<int> Function(Uri endpoint, String token, List<int> body)
Pluggable transport — return the HTTP status of the POST, or throw on network failure. The default uses dart:io.HttpClient.