fix: add missing error and exception details to console logs
-
Bugfix for missing error and exception details Describe the bug
TalkerData#generateTextMessageis missingdisplayExceptionanddisplayError, usesmessageinstead ofdisplayMessagewhich could cause "null" string in logs (intended?).TalkerLog#generateTextMessageis missingdisplayErrorwhich prevents printing errors to console log.To Reproduce
- Add custom log with error.
- Error is not printed.
Expected behavior
- Error should be included in output same as exception.
Summary by Sourcery
Ensure that error and exception details, along with the proper displayMessage, are included in console log output generated by TalkerData and TalkerLog
Bug Fixes:
- Replace raw message with displayMessage and include missing displayException and displayError in TalkerData generateTextMessage
- Add missing displayError to TalkerLog generateTextMessage so errors are printed to console logs
Reviewer's Guide
Update generateTextMessage implementations in TalkerData and TalkerLog to include missing error and exception details and replace raw message usage with displayMessage, ensuring full context is logged.
Class diagram for updated TalkerData and TalkerLog message generation
classDiagram
class TalkerData {
+String displayTitleWithTime(TimeFormat timeFormat)
+String displayMessage
+String displayException
+String displayError
+String displayStackTrace
+String generateTextMessage(TimeFormat timeFormat)
}
class TalkerLog {
+String generateTextMessage(TimeFormat timeFormat)
}
TalkerLog --|> TalkerData
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Enhanced TalkerData log formatting to include error and exception details |
|
packages/talker/lib/src/models/talker_data.dart |
| Extended TalkerLog formatting to include missing error output |
|
packages/talker/lib/src/models/talker_log.dart |
Possibly linked issues
- #1: PR fixes missing error/exception fields in TalkerLog, which resolves the empty fields in DioErrorLog issue.
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
-
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. -
Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Hello @Zekfad ! Could you please fix tests before we will merge it ?
Updated related tests and rebased to recent master. Please take a look @Frezyx