Skip to content

Commit a800956

Browse files
authored
Merge pull request reidmorrison#194 from Amnesthesia/fix/rails7.1
fix: remove undef :broadcast since ActiveSupport::Logger dropped it
2 parents 60fac85 + cba6f1b commit a800956

File tree

2 files changed

+18
-7
lines changed
  • .github/workflows
  • lib/rails_semantic_logger/extensions/active_support

2 files changed

+18
-7
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ jobs:
4141
- rails: "7.0"
4242
ruby: 3.2
4343
- rails: "7.0"
44-
ruby: jruby
44+
ruby: jruby
45+
- rails: "7.1"
46+
ruby: "3.0"
47+
- rails: "7.1"
48+
ruby: 3.1
49+
- rails: "7.1"
50+
ruby: 3.2
51+
- rails: "7.1"
52+
ruby: jruby
4553

4654
env:
4755
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile

lib/rails_semantic_logger/extensions/active_support/logger.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@ module ActiveSupport
44
# More hacks to try and stop Rails from being it's own worst enemy.
55
class Logger
66
class << self
7-
undef :logger_outputs_to?, :broadcast
7+
undef :logger_outputs_to?
8+
9+
# Prevent broadcasting since SemanticLogger already supports multiple loggers
10+
if method_defined?(:broadcast)
11+
undef :broadcast
12+
def broadcast(logger)
13+
Module.new
14+
end
15+
end
816
end
917

1018
# Prevent Console from trying to merge loggers
1119
def self.logger_outputs_to?(*args)
1220
true
1321
end
1422

15-
# Prevent broadcasting since SemanticLogger already supports multiple loggers
16-
def self.broadcast(logger)
17-
Module.new
18-
end
19-
2023
def self.new(*args, **kwargs)
2124
SemanticLogger[self]
2225
end

0 commit comments

Comments
 (0)