Skip to content

Conversation

@AlexV525
Copy link
Member

Resolves #2450

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

Additional context and info (if any)

@AlexV525
Copy link
Member Author

@copilot Add tests and update docs/comments accordingly

Copy link
Contributor

Copilot AI commented Nov 23, 2025

@AlexV525 I've opened a new pull request, #2463, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 23, 2025 17:04
…se controls (#2463)

Resolves #2450

Adds `requestUrl` and `responseUrl` boolean parameters to
`LogInterceptor` for granular control over URL logging, independent of
other request/response details.

### Changes

- **LogInterceptor API**: Added `requestUrl` (default: true) and
`responseUrl` (default: true) parameters
- **Tests**: Added 8 test cases covering flag combinations,
independence, and default values
- **Documentation**: Fixed incorrect doc comments (`requestUrl` was
labeled "request header")
- **CHANGELOG**: Added entry under Unreleased

### Example

```dart
dio.interceptors.add(
  LogInterceptor(
    requestUrl: true,      // Log request URL
    requestHeader: false,  // Skip request headers
    responseUrl: false,    // Skip response URL
    responseBody: true,    // Log response body
  ),
);
```

### New Pull Request Checklist

- [x] I have read the
[Documentation](https://pub.dev/documentation/dio/latest/)
- [x] I have searched for a similar pull request in the
[project](https://github.com/cfug/dio/pulls) and found none
- [ ] I have updated this branch with the latest `main` branch to avoid
conflicts (via merge from master or rebase)
- [x] I have added the required tests to prove the fix/feature I'm
adding
- [x] I have updated the documentation (if necessary)
- [ ] I have run the tests without failures
- [x] I have updated the `CHANGELOG.md` in the corresponding package

### Additional context and info (if any)

Tests will be validated by CI. Code review and security checks passed
locally.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: AlexV525 <15884415+AlexV525@users.noreply.github.com>
@github-actions
Copy link
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
dio/lib/src/interceptors/log.dart 🔴 1.79% 🟢 76.56% 🟢 74.77%
dio/lib/src/response.dart 🟠 55.56% 🟢 88.89% 🟢 33.33%
Overall Coverage 🟢 85.72% 🟢 88.12% 🟢 2.4%

Minimum allowed coverage is 0%, this run produced 88.12%

@AlexV525 AlexV525 marked this pull request as ready for review November 23, 2025 10:58
@AlexV525 AlexV525 requested a review from a team as a code owner November 23, 2025 10:58
@AlexV525 AlexV525 merged commit e9da702 into main Nov 23, 2025
3 checks passed
@AlexV525 AlexV525 deleted the feat/log-interceptor branch November 23, 2025 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dio prints debug message even if all LogInterceptors are turned off

3 participants