Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MeyerOppelt
Copy link
Contributor

@MeyerOppelt MeyerOppelt commented Jun 1, 2025

Thanks a lot for contributing!

#354
Added custom log documentation to make it more similar to the example app, and less confusing for first-time users

Summary by Sourcery

Revise and expand the custom log documentation in the README to demonstrate a new pattern using static getters for title, key, and pen, and to provide comprehensive examples for customizing log titles and colors in both Dart console and Flutter contexts.

Documentation:

  • Show how to define a custom log class using static getters for title, key, and pen and override instance getters.
  • Illustrate configuring custom log pens and titles in TalkerSettings with string literals, enum fields, and static variables.
  • Update Flutter TalkerScreenTheme examples to demonstrate overriding default and custom log colors using material and ARGB values.
  • Clarify usage of TalkerLogType getKey field instead of key for default log types.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 1, 2025

Reviewer's Guide

Enhances the README custom‐log documentation by refactoring the example class to use static getters with instance overrides, and by expanding both CLI (TalkerSettings colors and titles) and Flutter (TalkerScreen theme) examples to clearly illustrate default and custom log configuration patterns and ANSI color limitations in widgets.

Sequence Diagram: Configuring Talker using YourCustomLog Static Properties

sequenceDiagram
    actor Developer
    participant YCL as YourCustomLog
    participant TS as TalkerSettings
    participant T as Talker

    Developer->>YCL: Access static YourCustomLog.getKey()
    activate YCL
    YCL-->>Developer: logKey
    deactivate YCL

    Developer->>YCL: Access static YourCustomLog.getPen()
    activate YCL
    YCL-->>Developer: logPen
    deactivate YCL

    Developer->>YCL: Access static YourCustomLog.getTitle()
    activate YCL
    YCL-->>Developer: logTitle
    deactivate YCL

    Developer->>TS: new TalkerSettings(titles: {logKey: logTitle}, colors: {logKey: logPen})
    activate TS
    TS-->>Developer: configuredSettings
    deactivate TS

    Developer->>T: new Talker(settings: configuredSettings)
    activate T
    T-->>Developer: talkerInstance
    deactivate T
Loading

File-Level Changes

Change Details Files
Refactor custom log class snippet to static getters and instance overrides
  • Switch constructor to super.message shorthand
  • Introduce static getters for title, key, and pen
  • Override instance getters to return static values
  • Add doc comments explaining static‐vs‐instance workaround
README.md
Extend TalkerSettings CLI examples for colors and titles
  • Add default log color entries using AnsiPen
  • Show custom color mapping via string literal and static variable
  • Demonstrate reusing the static color getter
  • Update title map to use both string literals and static getters
README.md
Update Flutter TalkerScreen theming snippet
  • Replace ANSI pens with Flutter Color and Colors constants
  • Add custom log color examples using key string and static variable
  • Clarify ANSI limitations in widgets and recommend ARGB/Material colors
README.md

Possibly linked issues


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

@MeyerOppelt MeyerOppelt changed the title F/add custom log documentation Feature: Add Custom Log Documentation Jun 1, 2025
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MeyerOppelt - I've reviewed your changes - here's some feedback:

  • The Dart sample code contains syntax errors (e.g., String super.message forwarding constructor and missing parentheses on AnsiPen invocations) – please ensure the examples compile.
  • Static getters for getTitle, getKey, and getPen could be replaced with static const fields or more straightforward overrides to simplify the API.
  • The sample configuration maps contain duplicate entries for YourCustomLog.getKey; consider removing repetitions to keep examples concise.
Here's what I looked at during the review
  • 🟑 General issues: 3 issues found
  • 🟒 Security: all looks good
  • 🟒 Testing: all looks good
  • 🟒 Complexity: all looks good
  • 🟒 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

@MeyerOppelt
Copy link
Contributor Author

MeyerOppelt commented Jun 1, 2025

Fixed issues pointed out by Sourcery. Except for the String super.message constructor error, as that syntax is valid in 3.32.1 which is currently flutter's latest version.

Also did not fix repetition as it is explaining valid ways to use custom log colors.

@MeyerOppelt
Copy link
Contributor Author

@sourcery-ai review

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MeyerOppelt - I've reviewed your changes - here's some feedback:

  • Using static getters named getTitle/getKey/getPen adds unnecessary verbosity; consider using static const properties or simpler static getters named title/key/pen instead.
  • Several examples define the same map key twice (e.g., YourCustomLog.getKey) which can be misleading; consolidate each key into a single example entry for clarity.
Here's what I looked at during the review
  • 🟑 General issues: 1 issue found
  • 🟒 Security: all looks good
  • 🟒 Testing: all looks good
  • 🟒 Complexity: all looks good
  • 🟒 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment and I'll use the feedback to improve your reviews.

@Frezyx
Copy link
Owner

Frezyx commented Jun 3, 2025

Hello @MeyerOppelt !
Thank you so much for this documentation! πŸ‘πŸ»
It's very clear and easy to understand.

@Frezyx Frezyx merged commit 038fbb3 into Frezyx:master Jun 3, 2025
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.

Make documentation more clear on how to use custom logs and colors with the TalkerScreen

2 participants