epilog 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/epilog/rails/railtie.rb +15 -16
- data/lib/epilog/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0f45daf54940c2e7449ae321341278f537f642429728a646339d0ad057ff933
|
|
4
|
+
data.tar.gz: ffade4ca680a3908a8d9c6c5912647881420d217dfeffbfd4e843195df62e30c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 60d208d4fa4e7bf3b8948e2888bda13ed4cf052bb23719f9fcc8e510166a8486eb0318b668377b388e732b932ba756a76aa6d4295fbda517c44bb506c6b0a381
|
|
7
|
+
data.tar.gz: dbe0e0a0d5dcd03b20fa0ef1ea87241745dba275e2297d9cba1cd34135b30bc602bf9aac1e9994070696bcd36b9e2b6343d8dff9dadc658285fe95a9461c9d16
|
data/CHANGELOG.md
CHANGED
data/lib/epilog/rails/railtie.rb
CHANGED
|
@@ -55,12 +55,26 @@ module Epilog
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# In Rails 7.1+, the server, console, and other components (like Sidekiq)
|
|
59
|
+
# call Rails.logger.broadcast_to() to add additional log destinations.
|
|
60
|
+
# This causes duplicate log lines and can lead to blocks being executed
|
|
61
|
+
# multiple times (via BroadcastLogger's method_missing delegation).
|
|
62
|
+
#
|
|
63
|
+
# This initializer runs AFTER :initialize_logger (which wraps the logger
|
|
64
|
+
# in a BroadcastLogger) but BEFORE any after_initialize hooks (where
|
|
65
|
+
# Sidekiq and others add their loggers). This ensures the no-op is in
|
|
66
|
+
# place before anyone tries to call broadcast_to.
|
|
67
|
+
initializer 'epilog.prevent_broadcast', after: :initialize_logger do
|
|
68
|
+
if ::Rails.gem_version >= Gem::Version.new('7.1') && ::Rails.logger
|
|
69
|
+
::Rails.logger.define_singleton_method(:broadcast_to) { |*| nil }
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
58
73
|
# In Rails 7.1+, ActionView::LogSubscriber::Start are attached late
|
|
59
74
|
# in the initialization process, so we need to disable them after
|
|
60
75
|
# initialization completes
|
|
61
76
|
config.after_initialize do
|
|
62
77
|
disable_rails_defaults
|
|
63
|
-
prevent_double_logs_from_broadcast
|
|
64
78
|
end
|
|
65
79
|
|
|
66
80
|
class << self
|
|
@@ -101,21 +115,6 @@ module Epilog
|
|
|
101
115
|
end
|
|
102
116
|
end
|
|
103
117
|
|
|
104
|
-
# In Rails 7.1+, the server and console call Rails.logger.broadcast_to(console)
|
|
105
|
-
# which adds a second logger and causes every log line to appear twice
|
|
106
|
-
# (e.g. custom format + default Logger format). Override broadcast_to with
|
|
107
|
-
# a no-op to prevent adding duplicate destinations.
|
|
108
|
-
#
|
|
109
|
-
# This must be done in after_initialize (not at require time) because:
|
|
110
|
-
# 1. Rails wraps the logger in a BroadcastLogger during bootstrap
|
|
111
|
-
# 2. We need to override the instance method on the actual Rails.logger
|
|
112
|
-
def prevent_double_logs_from_broadcast
|
|
113
|
-
return if ::Rails.gem_version < Gem::Version.new('7.1')
|
|
114
|
-
return unless ::Rails.logger
|
|
115
|
-
|
|
116
|
-
::Rails.logger.define_singleton_method(:broadcast_to) { |*| nil }
|
|
117
|
-
end
|
|
118
|
-
|
|
119
118
|
def blacklisted_subscribers
|
|
120
119
|
ActiveSupport::LogSubscriber.log_subscribers.select do |subscriber|
|
|
121
120
|
SUBSCRIBER_BLACKLIST.include?(subscriber.class)
|
data/lib/epilog/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: epilog
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Justin Howard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-02-
|
|
11
|
+
date: 2026-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: combustion
|
|
@@ -120,7 +120,7 @@ licenses:
|
|
|
120
120
|
- MIT
|
|
121
121
|
metadata:
|
|
122
122
|
changelog_uri: https://github.com/nullscreen/epilog/blob/main/CHANGELOG.md
|
|
123
|
-
documentation_uri: https://www.rubydoc.info/gems/epilog/0.9.
|
|
123
|
+
documentation_uri: https://www.rubydoc.info/gems/epilog/0.9.2
|
|
124
124
|
rubygems_mfa_required: 'true'
|
|
125
125
|
post_install_message:
|
|
126
126
|
rdoc_options: []
|