talker_dio_logger_plus 1.0.6
talker_dio_logger_plus: ^1.0.6 copied to clipboard
Advanced and feature-rich Dio HTTP client logger with cURL export, JSON viewer, detail views, image support, and more
Changelog #
1.0.6 #
Breaking Changes #
- Removed placeholder boolean parameters:
enableJsonViewer,enableImagePreview,enableHtmlPreview, andenableDownloadhave been removed fromAdvancedDioLoggerSettings— these are now controlled entirely throughDisplayLimit.enablePreviewper content type inDisplayLimitRegistry, reducing ambiguity and centralising display configuration - Removed flat truncation parameters:
truncateThreshold(100 KB),maxDisplaySize(1 MB),imagePreviewThreshold(500 KB), andmaxInlineJsonLines(20) have been removed fromAdvancedDioLoggerSettings— these are now handled per content type viaDisplayLimit(maxBytes,maxLines) insideDisplayLimitRegistry; migrate by passing a customDisplayLimitRegistrywith the appropriateDisplayLimitoverrides perHttpBodyType - Removed
NoOpFileSaver: SetfileSaver: nullinAdvancedDioLoggerSettingsto disable download/share functionality — the UI gracefully shows "File saver is not configured" when attempting file operations with a nullfileSaver fileSaverdefaults toDefaultFileSaver(): If you previously relied onNoOpFileSaver, passfileSaver: nullinstead
Improvements #
- Memory optimization: Response bodies are now truncated at intercept time via
_PreparedBody.fromData()before storage in Talker history, preventing unbounded memory growth from large HTTP payloads - Cached text generation:
generateTextMessage()caches its result in_cachedTextMessageto avoid re-encoding large response bodies on every Talker history render - HTML content separation: HTML responses now stored in dedicated
htmlContentfield (instead ofresponseBody) to avoid duplicate in-memory copies;WebViewPreviewreads fromhtmlContentdirectly - Binary data sentinel: Binary/unknown response types replaced with a small human-readable sentinel string (e.g.,
"[Binary data — 4.20 MB]") instead of storing the full payload - Per-content-type display limits: Replaced flat truncation threshold with
DisplayLimitRegistry— a per-content-type registry mappingHttpBodyTypetoDisplayLimit(maxBytes, maxLines, enablePreview). UseenablePreview: falseon a specificHttpBodyTypeto disable inline preview for that type (replaces the oldenableJsonViewer,enableImagePreview,enableHtmlPreviewbooleans) - Immutable display limit registry:
DisplayLimitRegistryusesMap.unmodifiableinternally; all instances are effectively immutable after construction - Display limit clamping:
DisplayLimitfactory constructor clamps values to safe ranges (1 KB – 100 MB for bytes, 1 – 1000 for lines) - Crash-safe interceptor: Filter execution (
_shouldLog) and log creation (_emitLog) each wrapped in separate try/catch blocks withdebugPrintfallback — the interceptor never throws - Lazy log construction:
_emitLogaccepts abuildDatacallback so expensiveHttpLogDataFactorywork is skipped when the logger is disabled or filtered out - Decoupled header masking:
HeaderMaskerhas two API methods —mask()(raw params, used byCurlGenerator._processHeaders) andmaskFromSettings()(convenience wrapper, used byHttpLogDataFactory._buildBase) — soCurlGeneratordoes not depend onAdvancedDioLoggerSettings - Settings baked into logs: Each
AdvancedDioLogcarries the fullAdvancedDioLoggerSettingssnapshot, so the UI layer reads feature flags and display limits directly from the log without external dependencies - Nullable
fileSaver:FileSaverInterface?is nullable — set tonullto completely disable download/share/export features; the UI shows an informational message instead of crashing - JSON soft wrap: Added
jsonSoftWrapTextValueAtWidthsetting to constrain string value width inSearchableJsonViewer - Runtime settings update: Added
updateSettings()method toAdvancedDioLoggerfor changing settings without recreating the interceptor - Line-numbered preview:
HttpLogCardresponse body preview uses_CodePreviewwidget with line numbers and a vertical gutter separator - Response body preview guards: Card preview checks
maxBytesfirst and shows "too large for preview" message; then checksmaxLinesand truncates with "tap Detail" hint - FormData support in cURL:
CurlGeneratoremits proper-Fflags forFormDatafields and file parts instead of a generic-dbody - Content type detection via
mimepackage:ContentTypeDetectoruses themimepackage for magic-byte detection on binary responses (PNG, JPEG, GIF, WebP, etc.) copyWithon settings and models:AdvancedDioLoggerSettings,HttpLogData,DisplayLimit, andDisplayLimitRegistryall providecopyWithmethods for immutable updates- Status color respects
TalkerScreenTheme.logColors:StatusColorUtilreadslogColorsfrom the theme for request/response/error colours, falling back to built-in defaults
1.0.0 #
Features #
- Initial release
- cURL Generation: Generate cURL commands from HTTP requests
- Safe mode with hidden authorization headers
- Full mode with all values visible
- Interactive JSON Viewer: Searchable JSON viewer with syntax highlighting
- Expand/collapse nodes
- Search with highlighting
- Copy entire JSON
- Smart Data Truncation: Automatic truncation of large payloads
- Configurable per-content-type display limits via
DisplayLimitRegistry - Full content available in detail view
- Configurable per-content-type display limits via
- Multi-format Response Support:
- JSON with interactive viewer
- HTML with WebView preview (inline + full-screen)
- Images with inline/full preview and pinch-to-zoom
- Plain text
- Security Features:
- Hidden headers (Authorization, API keys, etc.)
- Bearer token masking
- Safe cURL export
- Export & Download:
- Download as ZIP file (request.txt, request_body, response.txt, response_body)
- Share via system dialog
- Copy individual sections
- Pluggable
FileSaverInterfacewithDefaultFileSaverandNoOpFileSaver
- Detail View:
- Tabbed interface (Overview, Request, Response)
- Full headers view with color coding
- Response time tracking
- Collapsible sections
- Theme Support:
TalkerThemeProviderInheritedWidget for theme propagation- Respects
TalkerScreenTheme.logColorsfor status colors
- Talker Compatibility:
- Runtime detection of Talker v4 vs v5
- Automatic key registration on v5+
- Custom
AnsiPenconfigurations for console output