Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console Friendly Logger #22

Open
7 tasks
Adeynack opened this issue Nov 8, 2022 · 0 comments
Open
7 tasks

Console Friendly Logger #22

Adeynack opened this issue Nov 8, 2022 · 0 comments

Comments

@Adeynack
Copy link
Contributor

Adeynack commented Nov 8, 2022

Problem

When using the bin/dev setup (in conjunction with tmux), Rails seems to think it's no longer in a development setup and stops outputting the debug logs (ex: the SQL queries, the views & controller debugging, ...). It seems to affect only modern-er version of Rails (>7, but to be confirmed).

Current Situation

A setup is copy/paste-ed in multiple projects (see list in Acceptance Criteria).

  • config/environment.rb, line ConsoleFriendlyLogger.auto_extend_rails!
  • app/models/console_friendly_logger.rb
  • app/models/log_severity_formatter.rb

Potential Issues to Fix

Double Output

It was observed in Anymator that the log output were appearing twice: once normal and once through the LogSeverityFormatter.

Opt-In Only

Make sure those behaviors are disabled by default -- at least the use of LogSeverityFormatter -- and opted-in explicitly via ENV. Also, use Shimmer's Config.foo? to read switches instead of manually re-implement with ENV.fetch.

Acceptance Criteria

This setup exists in those projects and should be removed when Shimmer implements them.

  • Code is implemented in Shimmer
  • Double Output problem is solved
  • Opt-In Only is implemented using Config for ENV
  • PR is open and flagged as waiting for this one, where code was removed and is using Shimmer's version in those projects:
    • anymator
    • copa-coupona
  • Usage is documented
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

No branches or pull requests

1 participant