talker icon indicating copy to clipboard operation
talker copied to clipboard

fix: add missing error and exception details to console logs

Open Zekfad opened this issue 5 months ago • 3 comments

  • Bugfix for missing error and exception details Describe the bug TalkerData#generateTextMessage is missing displayException and displayError, uses message instead of displayMessage which could cause "null" string in logs (intended?). TalkerLog#generateTextMessage is missing displayError which 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

Zekfad avatar Jul 16 '25 17:07 Zekfad

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
  • Replaced message property with displayMessage
  • Added displayException before error output
  • Added displayError before stack trace
packages/talker/lib/src/models/talker_data.dart
Extended TalkerLog formatting to include missing error output
  • Appended displayError to the log template
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 review on 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 issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on 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 dismiss on 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 review to 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.

sourcery-ai[bot] avatar Jul 16 '25 17:07 sourcery-ai[bot]

Hello @Zekfad ! Could you please fix tests before we will merge it ?

Frezyx avatar Jul 20 '25 09:07 Frezyx

Updated related tests and rebased to recent master. Please take a look @Frezyx

Zekfad avatar Oct 21 '25 22:10 Zekfad