You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, this was pain to solve so this is a pro-active issue, perhaps we can mention this in the readme or something.
Rails devs refactored logger silencing code in 5.0 (rails/rails@2518bda) in a way that the code responsible for storing temporary level is now part of logger instead of silencer. This renders logging gem incompatible if silence method is overridden in Rails app leading to loosing level on concurrent silencing access, which happens all the time for us (for example sprockets gem silences logs, we have silencers in our code as well). After some time or immediately after start, level is reset to error level which makes development impossible (no debug messages).
While I share your opinion that silencing is bad and I think it comes from fact that Ruby/Rails both don't have trace level (more than debug, useful as opt-in development level when haunting bugs), I think this is worth mentioning somewhere in docs. Of course, if an app keeps using your RailsCompat module (#11) then there should be no problem, but pragmatic way of getting rid of too detailed logs is unfortunately to implement your own silence (until Rails adopts Logging gem :-)
For googlers, the obvious workaround is to store temporary levels in thread-local variables: theforeman/foreman#5197
The text was updated successfully, but these errors were encountered:
Hey, this was pain to solve so this is a pro-active issue, perhaps we can mention this in the readme or something.
Rails devs refactored logger silencing code in 5.0 (rails/rails@2518bda) in a way that the code responsible for storing temporary level is now part of logger instead of silencer. This renders logging gem incompatible if silence method is overridden in Rails app leading to loosing level on concurrent silencing access, which happens all the time for us (for example sprockets gem silences logs, we have silencers in our code as well). After some time or immediately after start, level is reset to error level which makes development impossible (no debug messages).
While I share your opinion that silencing is bad and I think it comes from fact that Ruby/Rails both don't have trace level (more than debug, useful as opt-in development level when haunting bugs), I think this is worth mentioning somewhere in docs. Of course, if an app keeps using your
RailsCompat
module (#11) then there should be no problem, but pragmatic way of getting rid of too detailed logs is unfortunately to implement your ownsilence
(until Rails adopts Logging gem :-)For googlers, the obvious workaround is to store temporary levels in thread-local variables: theforeman/foreman#5197
The text was updated successfully, but these errors were encountered: