Skip to content

chore: load amazing_print only in development and test - #2972

Merged
mroderick merged 1 commit into
masterfrom
chore/amazing-print-dev-group
Oct 1, 2026
Merged

mroderick merged 1 commit into
masterfrom
chore/amazing-print-dev-group

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

amazing_print was declared in the default Gemfile group, so Bundler.require loaded it on boot in every environment, including production dynos. Nothing in the app uses it there: production logs go through CanonicalJsonFormatter, and the only consumer of the gem anywhere is SemanticLogger::Formatters::Color, which soft-requires it to pretty-print payload hashes in coloured text logs. That formatter is only relevant to development and test console output.

  • Move the gem into group :development, :test, alongside the other dev-only gems
  • Update the stale comment left over from the original rails_semantic_logger suggestion
  • No Gemfile.lock change — the lockfile does not record groups

Review notes

  • Single-line Gemfile change; the only behaviour change is that amazing_print is no longer loaded in production
  • Deliberately not done: removing the gem entirely, which would lose coloured payload pretty-printing in the dev console

Amazing_print is only used by SemanticLogger colour-formatted text logs
in development; production logs go through CanonicalJsonFormatter and
never touch it. Keeping it in the default group made every production
dyno load an unused gem.
@mroderick
mroderick requested a review from olleolleolle October 1, 2026 08:19
@mroderick
mroderick marked this pull request as ready for review October 1, 2026 08:19
@mroderick
mroderick merged commit 072e859 into master Oct 1, 2026
10 checks passed
@mroderick
mroderick deleted the chore/amazing-print-dev-group branch October 1, 2026 08:23
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