Build and pass tags as options to logger#15
Conversation
0812102 to
80bedea
Compare
| gem "bake-test-external" | ||
|
|
||
| gem "sqlite3", "~> 1.4" | ||
| gem "sqlite3", ">= 1.4" |
There was a problem hiding this comment.
this way it works with rails 8.0+
|
Apologies for the late review. I've just released v0.5 which fixes compatibility with Rails thanks to @jasl Do you mind rebasing this? |
1932457 to
c6ab122
Compare
|
Hey @ioquatix |
|
I'll check and fix red CI a bit later, sorry :( |
|
@ioquatix sorry it took extremely long |
There was a problem hiding this comment.
Pull request overview
Adds support for propagating Rails.logger.tagged hash tags into Console log entries by converting tag hashes into keyword options passed to the underlying Console logger, enabling structured log context (e.g., request_id) to appear as fields.
Changes:
- Merge
ActiveSupport::TaggedLoggingtag hashes into log payload options inConsole::Adapter::Rails::Logger#add. - Add tests validating hash tag propagation and ensuring string tags don’t break logging.
- Bump
consolegem dependency to a newer version to support the new keyword-options behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
lib/console/adapter/rails/logger.rb |
Builds an options hash from Rails tag stack and forwards it as keyword options to Console logging. |
test/console/adapter/rails/logger.rb |
Adds coverage for hash tags being logged as fields and string tags being ignored safely. |
console-adapter-rails.gemspec |
Updates console dependency requirement to a newer minor series. |
db9d748 to
a4bd0c5
Compare
a4bd0c5 to
c7673d2
Compare
Issue
This is one of 2 changes needed to support the use of
Rails.logger.tagged(another part)This only works with hash type tags, e.g.
Rails.logger.tagged({ request_id: 137 })Types of Changes
Contribution