LeanCode Debug Page
A debug page that gathers HTTP requests and logger logs with detailed filtering, sharing capabilities, and configurable entry points. Essential for debugging network requests and application logs during development and testing.Features
- HTTP Request Tracking: Capture and display detailed information about all HTTP requests and responses
- Logger Integration: Gather and display logs from the
loggingpackage - Advanced Filtering:
- Requests by status code and search query
- Logs by log level and search query
- Sharing Capabilities:
- Share all logs or requests
- Share individual items
- Flexible Entry Points:
- Draggable floating action button
- Device shake detection
Installation
Integration
Create LoggingHttpClient
Wrap your HTTP client with
LoggingHttpClient to enable request tracking:LoggingHttpClient is a wrapper over the standard http.Client that logs all requests and responses while maintaining full compatibility with the HTTP package.Complete Example
Configuration
DebugPageController Options
Entry Point Configuration
showEntryButton: Display a draggable floating action button for quick accessshowOnShake: Enable shake gesture to open the debug page (requiressensors_plus)ignoredBasePath: Optional base path to exclude from request URLs in the display
Shake Detection
By default, shaking your device will open the debug page. The shake detector uses:- Threshold: 4 gravity units
- Auto-start: Automatically begins listening when enabled
- Auto-stop: Stops listening when controller is disposed
Debug Information Exposed
HTTP Requests
For each HTTP request, the debug page displays:-
Request Details:
- HTTP method (GET, POST, PUT, DELETE, etc.)
- Full URL
- Request headers
- Request body (for applicable methods)
- Timestamp (start time)
-
Response Details:
- Status code
- Response headers
- Response body
- Duration (time taken)
-
Filtering:
- Filter by status code ranges (1xx, 2xx, 3xx, 4xx, 5xx)
- Search by URL or content
Logger Logs
The debug page captures logs fromLogger.root:
-
Log Information:
- Log level (SEVERE, WARNING, INFO, CONFIG, FINE, FINER, FINEST)
- Message
- Timestamp
- Logger name
- Error and stack trace (if available)
-
Filtering:
- Filter by log level
- Search by message content
API Reference
LoggingHttpClient
DebugPageController
Use Cases
Network Debugging
Network Debugging
View all API requests and responses in real-time. Useful for:
- Debugging API integration issues
- Verifying request/response payloads
- Checking authentication headers
- Monitoring response times
Log Analysis
Log Analysis
Collect and filter application logs. Perfect for:
- Troubleshooting runtime issues
- Monitoring error patterns
- Reviewing debug information
- Sharing logs with team members
QA and Testing
QA and Testing
Enable QA teams to:
- Report issues with detailed network logs
- Share complete request/response data
- Filter and search through logs efficiently
- Verify API behavior without development tools
Package Information
- Latest Version: 3.1.0+1
- Minimum Dart SDK: 3.6.0
- Minimum Flutter: 3.27.0
- Repository: GitHub
- Pub.dev: leancode_debug_page
Dependencies
http: ^1.1.0 - HTTP client integrationlogging: ^1.2.0 - Logger integrationrxdart: ^0.28.0 - Reactive stream handlingsensors_plus: ^6.0.0 - Shake detectionshare_plus: ^10.0.0 - Sharing capabilities
The debug page automatically uses the current isolate’s logger. Make sure your logging setup directs logs to
Logger.root for them to appear in the debug page.