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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ac4b15922bc0e1c3c38b10294d3f77c3a6c6ae3f5b2af5a619e4adcfdc6e048
4
- data.tar.gz: 02d8a2ae1e715a3a3d7f1311eb9ba663482741fbce231b3a9b30096fd1eb94f6
3
+ metadata.gz: e0f45daf54940c2e7449ae321341278f537f642429728a646339d0ad057ff933
4
+ data.tar.gz: ffade4ca680a3908a8d9c6c5912647881420d217dfeffbfd4e843195df62e30c
5
5
  SHA512:
6
- metadata.gz: c24a853903514771cc7847d7c9f7a08ae48619e3478711a94dc8b1d698465aaa581731037fc4553ff8e9f382103bb0ed1a3f89879a503a3cb7d4fa3cdda8f4e1
7
- data.tar.gz: '0190bdd527b8c2ca361d0837443c3e6f411809f8f5a9ce1c48bfc2f4cfe61a254fa5e0c269aaaf116bf504ef87b96b142fd69abb42d486f8cb7e48ed12bc9174'
6
+ metadata.gz: 60d208d4fa4e7bf3b8948e2888bda13ed4cf052bb23719f9fcc8e510166a8486eb0318b668377b388e732b932ba756a76aa6d4295fbda517c44bb506c6b0a381
7
+ data.tar.gz: dbe0e0a0d5dcd03b20fa0ef1ea87241745dba275e2297d9cba1cd34135b30bc602bf9aac1e9994070696bcd36b9e2b6343d8dff9dadc658285fe95a9461c9d16
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.2
4
+
5
+ - Fix double log issue in Rails 7.1+
6
+
3
7
  ## 0.9.1
4
8
 
5
9
  - Remove Rails 8 from CI
@@ -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)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Epilog
4
- VERSION = '0.9.1'
4
+ VERSION = '0.9.2'
5
5
 
6
6
  def self.version
7
7
  Gem::Version.new(VERSION)
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.1
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-10 00:00:00.000000000 Z
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.1
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: []