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
Application/framework names and versions: Rails 6.1.7.4, Puma: 5.6.9
Rails Semantic Logger Version: 4.17.0.
Solidus e-commerce platform
Description
I encountered an issue while using rails_semantic_logger in a Rails project with the Solidus framework. When SemanticLogger.default_level = :info or config.log_level = :info is set, debug-level logs return false, which leads to unexpected behavior.
Here’s a simplified example of the issue:
order=Spree::Order.firstorder.logger.debug"Testing"# This output `false` while the original behavior is to return `true` even if log level is set to :info
This behavior affects the Solidus gem's state_machine logic, where debug logs are used in transition callbacks. For example:
after_transition do |order, transition|
order.logger.debug "Order #{order.number} transitioned from #{transition.from} to #{transition.to} via #{transition.event}"
end
When logs are set to :info, the state_machine process fails silently.
Context
This logic is part of the Solidus framework, and no issues related to this behavior have been reported in their repository.
The problem arises because when log_level is set to info, logger.debug returns false
Expected Behavior
Even when default_level or config.log_level is set to :info, calls to logger.debug should return true as it happens with the original ActiveSupport::Logger
The text was updated successfully, but these errors were encountered:
Environment
Description
I encountered an issue while using
rails_semantic_logger
in a Rails project with the Solidus framework. WhenSemanticLogger.default_level = :info
orconfig.log_level = :info
is set, debug-level logs returnfalse
, which leads to unexpected behavior.Here’s a simplified example of the issue:
This behavior affects the Solidus gem's state_machine logic, where debug logs are used in transition callbacks. For example:
You can see this code in context here
When logs are set to :info, the state_machine process fails silently.
Context
false
Expected Behavior
Even when default_level or config.log_level is set to :info, calls to logger.debug should return
true
as it happens with the originalActiveSupport::Logger
The text was updated successfully, but these errors were encountered: