Skip to content

chore: enhance logging for after_start/1 callback to include stop reason - #36

Merged
yordis merged 1 commit into
mainfrom
yordis/chore-3
Nov 21, 2025
Merged

yordis merged 1 commit into
mainfrom
yordis/chore-3

Conversation

@yordis

@yordis yordis commented Nov 20, 2025 •

Copy link
Copy Markdown
Member

Note

When after_start/1 returns {:stop, reason}, log at info level and include the stop reason.

Written by Cursor Bugbot for commit cac8d39. This will update automatically on new commits. Configure here.

@yordis
yordis marked this pull request as ready for review November 20, 2025 23:59
@coderabbitai

coderabbitai Bot commented Nov 20, 2025 •

Copy link
Copy Markdown

Walkthrough

Handle_info for the {:subscribed, subscription} clause now logs subscription stop events at info level and includes the inspected stop reason in the message; no public API or exported signatures were changed. (≤50 words)

Changes

Cohort / File(s) Summary
Logging enhancement
lib/commanded/event/handler.ex
In handle_info's {:subscribed, subscription} clause, changed the {:stop, reason} log from :debug to :info and updated the message to include inspect(reason). No public/exported declarations altered.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single-line behavioral change in one file.
  • Low risk; review attention: lib/commanded/event/handler.ex (ensure logging semantics and formatting are correct).

Possibly related PRs

Poem

🐰 A gentle hop, a log made clear,
From debug whispers to info near,
The stop's small reason tucked in sight,
I nibble bytes and cheer the light. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: enhancing logging for the after_start/1 callback to include the stop reason.
Description check ✅ Passed The description clearly relates to the changeset, explaining that when after_start/1 returns {:stop, reason}, the handler logs at info level and includes the inspected reason.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch yordis/chore-3

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec31e5e and cac8d39.

📒 Files selected for processing (1)
  • lib/commanded/event/handler.ex (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/commanded/event/handler.ex
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Quality Assurance (1.18.x, 27)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
lib/commanded/event/handler.ex (1)

932-934: LGTM! Good observability improvement.

The change to info level and including the stop reason enhances observability for handler initialization lifecycle events. The message format is clear and helpful for debugging.

For consistency, consider updating the similar logging pattern for the before_reset/0 callback at lines 897-900, which currently uses debug level:

       {:stop, reason} ->
-        Logger.debug(
+        Logger.info(
           describe(state) <>
             " `before_reset/0` callback has requested to stop. (reason: #{inspect(reason)})"
         )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4762803 and ec31e5e.

📒 Files selected for processing (1)
  • lib/commanded/event/handler.ex (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Quality Assurance (1.18.x, 27)

…eason

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 436be06 into main Nov 21, 2025
6 of 7 checks passed
@yordis
yordis deleted the yordis/chore-3 branch November 21, 2025 00:09
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.

1 participant