flog_logger library

Lightweight structured logger for Flutter.

Outputs [LEVEL][Tag] message format that flog parses natively.

final log = FlogLogger('Network');
log.i('-> GET /api/users');
log.e('Connection failed', error: e, stackTrace: st);

Classes

FlogHttpInterceptor
Dio interceptor that emits flog_net protocol messages for HTTP traffic.
FlogLogger
FlogSseParser
Wraps an SSE (Server-Sent Events) byte stream and emits flog_net protocol messages for each event, while forwarding the parsed data downstream.
FlogWebSocket
A WebSocket wrapper that emits flog_net protocol messages for all WebSocket traffic (open, send, receive, close).

Functions

emitNet(Map<String, dynamic> data) → void
Emit a flog_net protocol message. Uses print() so it works with all flog data sources (VM Service, ADB, stdin).
nextNetId() int
Get next unique request ID.

Typedefs

FlogHttpFilter = bool Function(RequestOptions options)
Predicate to decide whether a request should be logged.