Skip to content

Use tagged logging in Alchemy:Logger#3557

Merged
tvdeyen merged 8 commits intomainfrom
alchemy-logger-proper
Jan 9, 2026
Merged

Use tagged logging in Alchemy:Logger#3557
tvdeyen merged 8 commits intomainfrom
alchemy-logger-proper

Conversation

@tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jan 9, 2026

What is this pull request for?

Uses Rails' tagged logging and adds more log levels, so that logging inside of Alchemy is better structured
and better consumable by log subscribers.

Notable changes

Deprecates the second argument (stack trace) to Alchemy::Logger.warn

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@tvdeyen tvdeyen added this to the 8.1 milestone Jan 9, 2026
@tvdeyen tvdeyen added the enhancement New feature or enhancement label Jan 9, 2026
@tvdeyen tvdeyen requested a review from a team as a code owner January 9, 2026 08:58
@tvdeyen tvdeyen changed the title Use proper logging in Alchemy:Logger Use tagged logging in Alchemy:Logger Jan 9, 2026
@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 92.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.35%. Comparing base (5a0ac20) to head (da01802).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lib/alchemy/engine.rb 0.00% 2 Missing ⚠️
lib/alchemy/errors.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3557   +/-   ##
=======================================
  Coverage   97.35%   97.35%           
=======================================
  Files         308      308           
  Lines        8011     8025   +14     
=======================================
+ Hits         7799     7813   +14     
  Misses        212      212           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Log an actual warning and not debug
message.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
This adds a nice little `[alchemy]` log
tag.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Rails logger does not support backtraces.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Use `Alchemy::Logger.warn` instead.

This let's use get rid of the Alchemy::Logger
includes in several places.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Add debug, error and info log levels.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Alchemy::Logger uses Rails.logger, but
tagged with `[alchemy]`.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Be a bit more helpful.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
For warnings and errors we add the Type
as prefix, so it easier to visually parse
in logs.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
@tvdeyen tvdeyen force-pushed the alchemy-logger-proper branch from c698aad to da01802 Compare January 9, 2026 11:20
Copy link
Contributor

@sascha-karnatz sascha-karnatz left a comment

Choose a reason for hiding this comment

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

Looks good

@tvdeyen tvdeyen merged commit c2a84aa into main Jan 9, 2026
18 of 19 checks passed
@tvdeyen tvdeyen deleted the alchemy-logger-proper branch January 9, 2026 13:41
@tvdeyen tvdeyen removed the enhancement New feature or enhancement label Jan 27, 2026
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.

2 participants