Skip to content

Deprecate ActiveSupport::LogSubscriber.colorize_logging - #59628

Open
thomasklemm wants to merge 1 commit into
rails:mainfrom
thomasklemm:thomasklemm/log-subscriber-colorize-logging-deprecation
Open

thomasklemm wants to merge 1 commit into
rails:mainfrom
thomasklemm:thomasklemm/log-subscriber-colorize-logging-deprecation

Conversation

@thomasklemm

@thomasklemm thomasklemm commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Through 8.1, ActiveSupport::LogSubscriber declared mattr_accessor :colorize_logging. aebcb61 moved color logging into ActiveSupport::ColorizeLogging and the setting to ActiveSupport.colorize_logging. The instance reader survived, but the class-level reader and writer went away without a deprecation.

Gems still call it. awesome_print 1.9.2, the latest stable release, runs this when it loads:

AwesomePrint.force_colors! ActiveSupport::LogSubscriber.colorize_logging

On main that raises NoMethodError inside Bundler.require, so apps that load awesome_print fail to boot. administrate's example app is one.

administrate example app 8-1-stable main this PR
boots with awesome_print 1.9.2 yes NoMethodError yes, one deprecation warning

This brings back LogSubscriber.colorize_logging and colorize_logging= as deprecated methods that delegate to ActiveSupport.colorize_logging, so the old and new names cannot disagree. They warn and will be removed in Rails 9.0. The test sets the value through each name, reads it back through the other, and restores it.


Found by running the test suites of widely used gems on Rails main and 8-1-stable side by side (record, part of my research project Lowrail).

The class-level accessor went away without a deprecation when color
logging moved to ActiveSupport::ColorizeLogging, so gems that read it
while loading, such as awesome_print, raised NoMethodError. Bring it
back as a deprecated reader and writer that delegate to
ActiveSupport.colorize_logging.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant