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
I have been experiencing numerous RuntimeError: <empty error message> errors on Airbrake. Upon investigation, I discovered that these errors occur when using logger with a block.
For instance, Rails.logger.warn("Error") works as intended, and I get RuntimeError: Error. However, when using Rails.logger.warn { "Error" }, I get the RuntimeError: <empty error message>.
Upon reviewing the code, I noticed that the warn method, - as well as the other log levels - receives the block as a parameter but does not pass it forward neither evaluates it to get the message. In scenarios involving blocks, the progname is nil, therefore an empty error message.
It is highly recommended to use blocks when logging for performance reasons, as stated in the Rails Debugging Guide.
I change all my loggers to not use a block for now, but unfortunately, most of the errors are related to ActiveJob::LogSubscriber, and there isn't much I can do about it.
Is there a possibility of addressing this issue and fixing the error messages?
Hello,
I have been experiencing numerous
RuntimeError: <empty error message>
errors on Airbrake. Upon investigation, I discovered that these errors occur when using logger with a block.For instance,
Rails.logger.warn("Error")
works as intended, and I getRuntimeError: Error
. However, when usingRails.logger.warn { "Error" }
, I get theRuntimeError: <empty error message>
.Upon reviewing the code, I noticed that the warn method, - as well as the other log levels - receives the block as a parameter but does not pass it forward neither evaluates it to get the message. In scenarios involving blocks, the progname is nil, therefore an empty error message.
It is highly recommended to use blocks when logging for performance reasons, as stated in the Rails Debugging Guide.
I change all my loggers to not use a block for now, but unfortunately, most of the errors are related to ActiveJob::LogSubscriber, and there isn't much I can do about it.
Is there a possibility of addressing this issue and fixing the error messages?
Gemfile.lock
The text was updated successfully, but these errors were encountered: