dio_debug_logger 0.4.1
dio_debug_logger: ^0.4.1 copied to clipboard
In-app network inspector for Dio: searchable request list, request and response details, stats, retry, cURL export and dev/staging/prod switching.
0.4.1 #
- Homepage now points to https://samiragaev.com.
0.4.0 #
Security #
- Secrets are masked everywhere: passwords, tokens, API keys, cookies, OTP/PIN and card
data in headers, body fields (nested JSON, JSON strings, form-encoded,
FormData) and URL query parameters — in the log UI, the console, every copy format andexportAll(). Previously only headers were masked. - The detail page hides secrets by default; the 👁 button reveals them until the app restarts.
DioDebugLogger.sensitiveKeysto add your own field names.- Masks no longer show the first and last characters of a value.
- Off in release builds everywhere:
DebugLogging(added directly),DebugOverlayand the deprecatedNetworkLogger.overlayBuilder()/interceptor()now default tokDebugModetoo. A disabled interceptor passes requests through untouched. - Enabling the logger in a release build prints a warning;
DioDebugLogger.open()does nothing in release builds without an explicit opt-in. - Retry resends with the Dio that made the request, keeping certificate pinning and
interceptors (
retryClientBuilderstill takes precedence).
Changed #
- Environment switcher screenshot in the README and on pub.dev.
- The copy dialog switch is now Hide secrets and also covers bodies and URLs.
generateResponseBodymasks secrets by default (redact: falseto turn off).- Console output no longer prints query parameters separately (they're in the masked URL).
0.3.0 #
Environment switching #
- Switch the backend (dev / staging / prod…) at runtime from the log page:
dio.addDebugLogger(environments: [DebugEnvironment('Dev', baseUrl: ...), ...]). - The selected environment is shown under the page title and as a badge on the floating
button, and is remembered between app starts (
shared_preferences). - Only requests to one of the listed base URLs are rewritten; other hosts are left alone. Several Dio instances with the same environment names switch together.
DioDebugLogger.setEnvironments([...])for Dio instances created lazily.DioDebugLogger.environment,setEnvironment()andonEnvironmentChanged.- Release builds are unaffected: the logger (and the rewriting) is not added.
- Demo app: switch between Dev / Staging / Prod.
0.2.1 #
- New demo app in
example/with a built-in fake API: GET / POST / PUT / PATCH / DELETE, auth tokens, FormData upload, slow and large responses, HTTP errors (400–503), timeouts, connection errors and cancelled requests. - Animated demo on the pub.dev page and in the README.
0.2.0 #
Simpler setup #
- New
dio.addDebugLogger()extension — adds the interceptor once (repeated calls are ignored). - New
DioDebugLoggerclass — the single entry point, named after the package.DioDebugLogger.builder()replacesNetworkLogger.overlayBuilder(). DioDebugLogger.builder(builder: ...)wraps an existingMaterialApp.builder.- Safe by default:
addDebugLogger()andDioDebugLogger.builder()are disabled in release builds (enableddefaults tokDebugMode).
Deprecated #
NetworkLogger→ useDioDebugLogger. It still works and keeps its old defaults (overlayBuilder()is enabled by default).openDebugPage/closeDebugPage→ useDioDebugLogger.open/DioDebugLogger.close.
Other #
- Documentation, API docs, example app and remaining UI strings translated to English.
Azerbaijani README:
README.az.md.
0.1.0 #
pub.dev #
- Package renamed
logging_service→dio_debug_logger(the old name is taken on pub.dev). Import:package:dio_debug_logger/dio_debug_logger.dart. - Added MIT license,
repository/issue_tracker/topics/screenshots. - Unused native plugin templates are excluded from the package via
.pubignore.
Bug fixes #
DebugPagedid not listen toDebugStorage, so new requests did not appear while it was open. All pages (list, details, analytics) now update live.- The
Dismissiblekey wasid-index; when the list changed the key shifted and the wrong item was deleted. The key is now theidonly, and deletion is byid. DebugStorage.clear()reset the counter, so a pending request could share anidwith a new one (duplicate key → render error). The counter is no longer reset.- Non-
Stringheader values (content-length: 120,accept: [a, b]) caused a type error inText(entry.value). All headers are normalized now. hasErrorsometimes counted pending requests as errors; aPendingstate was added (no morenull ms/ wrong "Success" label).CopyHelper.generateCurlCommanddid not escape single quotes (broken cURL), andjsonEncodethrew on unencodable bodies. Both fixed;FormDatais now written with-F.RetryDialogcould callsetStateafterdispose, resent thecontent-lengthheader and did not show 4xx/5xx results.- The copy dialog called
ScaffoldMessenger.of(context)afterNavigator.pop. pubspec.yamlreferenced a missinglogging_service_web.dart(broke web builds). The unused platform plugin definition and dependencies (flutter_screenutil,intl,web,plugin_platform_interface) were removed.
Responsive #
- Tablet scale factor was
3.0, so text overflowed. Now1.12(≥600dp) /1.25(≥900dp), and0.85–1.15on phones. - The system font size is capped at
1.25on the debug pages. maxLines+ellipsison all text;SelectableTextfor long values; fixed-width status/method labels withFittedBox; statistics cards useWrap.- Content is centered on wide screens (max 1000dp).
New #
DebugOverlay/NetworkLogger.overlayBuilder()— draggable button with badge, edge snapping and double-open protection. NonavigatorKey/navigatorObserversrequired.NetworkLogger—open,close,isOpenNotifier,configure,retryClientBuilder.- Search (URL / method / status) and status filter (All / Success / Errors / Pending).
- ⋮ menu: Analytics, Pause/Resume recording, Copy all as JSON, Clear all.
- Detail header (status, duration, ↑/↓ size) and JSON tree ↔ raw text toggle.
FormDatasupport in the request view, cURL and JSON.- Sensitive header masking (
Authorization,Cookie,X-Api-Key, …) in the console, copy and export. CopyHelper.generateSummary(bug report text) andgenerateResponseBody.DebugStorage:deleteById,deleteByIds,findById,setRecording,configure,exportAll,successCount,pendingCount,averageElapsedMs.DebugModel:status,isPending,isSuccess,requestSize,responseSize,underlyingError,toJson,matches.- Tests added (
flutter test).
0.0.1 #
- Initial release.
