Skip to content

Commit b0df338

Browse files
committed
Enable log subscriber silenced? patch only for 7.1.1
1 parent 6f32736 commit b0df338

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
require "active_support/log_subscriber"
1+
if ActiveSupport::VERSION::STRING == '7.1.1'
2+
require "active_support/log_subscriber"
23

3-
module ActiveSupport
4-
class LogSubscriber
5-
# @override Rails 7.1
6-
def silenced?(event)
7-
native_log_level = @event_levels.fetch(event, ::Logger::Severity::FATAL)
8-
logger.nil? || SemanticLogger::Levels.index(logger.level) > SemanticLogger::Levels.index(native_log_level)
4+
module ActiveSupport
5+
class LogSubscriber
6+
# @override Rails 7.1
7+
def silenced?(event)
8+
native_log_level = @event_levels.fetch(event, ::Logger::Severity::FATAL)
9+
logger.nil? || SemanticLogger::Levels.index(logger.level) > SemanticLogger::Levels.index(native_log_level)
10+
end
911
end
1012
end
1113
end

0 commit comments

Comments
 (0)