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

overhaul Reflex logging #546

Merged
merged 1 commit into from
Sep 28, 2021
Merged

Conversation

leastbad
Copy link
Contributor

Type of PR (feature, enhancement, bug fix, etc.)

Enhancement

Description

SR now logs errors to StimulusReflex.config.logger, which defaults to Rails.logger but can be set in the SR initializer.

debug info warn error fatal unknown are all supported.

This PR should be completely transparent to most developers, except that they will now see Reflex logs (at info log level) in their Rails log.

Why should this be added

The SR Logger class inexplicably used puts instead of writing to the Rails logger. This had the effect of making it so that Reflex "logs" show up in the server output even if logs are disabled, but don't show up in Rails logs even if logs are enabled. This is dumb!

Checklist

  • My code follows the style guidelines of this project
  • Checks (StandardRB & Prettier-Standard) are passing
  • This is not a documentation update

@leastbad leastbad added enhancement New feature or request proposal ruby Pull requests that update Ruby code labels Sep 14, 2021
@leastbad leastbad added this to the 3.5 milestone Sep 14, 2021
@leastbad leastbad self-assigned this Sep 14, 2021
@leastbad leastbad merged commit e00ef94 into stimulusreflex:master Sep 28, 2021
@leastbad leastbad deleted the rails_logger branch September 28, 2021 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal ruby Pull requests that update Ruby code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant