flog_dart library
Lightweight structured logger and network inspector bridge for Flutter.
Sends structured log messages and HTTP/SSE/WebSocket traffic metadata to the flog TUI via a Direct Socket WebSocket server. The authoritative entry point is Flog.init; see its dartdoc for the canonical bootstrap example.
Classes
- Flog
- Top-level entry point for flog_dart.
- FlogDio
-
A drop-in replacement for
Diothat automatically instruments HTTP requests for the flog Network Inspector. - FlogHttpConfig
- Configuration for FlogDio's automatic HTTP interception.
- FlogHttpInterceptor
- Dio interceptor that emits flog_net protocol messages for HTTP traffic.
- FlogLogger
- FlogMockInterceptor
- Dio interceptor that intercepts requests matching mock rules from flog.
- FlogMockRule
- A single mock rule received from flog via VM Service extension.
- FlogServer
- Singleton WebSocket server for communicating with flog TUI.
- FlogSseParser
- v0.7-compatible SSE parser facade.
- FlogSseReporter
-
Telemetry tee for an SSE event stream. Emits flog_net protocol messages
(
req/chunk/res/err) while passing every event downstream untouched. - FlogStore
- Singleton ring buffer for all outbound flog messages.
- FlogWebSocket
- A WebSocket wrapper that emits flog_net protocol messages for all WebSocket traffic (open, send, receive, close).
- SseByteDecoder
- Stream transformer that decodes a raw byte stream into UTF-8 text chunks, handling multi-byte boundary splits that land mid-sequence.
- SseEvent
- A single Server-Sent Event, per the W3C EventSource specification.
- SseLineDecoder
- W3C Server-Sent Events line-and-field parser as a proper stream transformer. Consumes decoded UTF-8 text chunks, emits SseEvents on dispatch.
- SseResponse
-
Response object returned by FlogDio.sse and
flogSse.
Constants
- flogEnabled → const bool
- kFlogMockedExtrasKey → const String
-
The
options.extrakey FlogMockInterceptor sets to mark a request as mocked. FlogHttpInterceptor reads it back to emitmocked: trueon the response log. Exposed as a single const so the magic string lives in one place (DART-014).
Typedefs
- FlogHttpFilter = bool Function(RequestOptions options)
- Predicate to decide whether a request should be logged.