rails_semantic_logger 4.3.1 → 4.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 934f14af66478e5e06804df98a16baa607daba3743c9216f519edeeff63c877c
4
- data.tar.gz: dfbbd3867ea7022a79cfb4a03be13851b8933eba1a730d1502cf1408fb725a80
3
+ metadata.gz: e6b01dd1f64e486ec066a9748b06400742da99c5089b3d142c79f69b74d8681d
4
+ data.tar.gz: 1ee4c3bd26b1bf8291cc35bbd7e5d7e414d5bef27e82dd57b371e7a89a9bf896
5
5
  SHA512:
6
- metadata.gz: 293e1f77e70ef70643048a4210aea3da07822ffd1b8a99aee4cc9dce3c6de3ae0aeccde7fc6f83b0d38aa4600085f4cef6052f9e6b8bbacfe096f2142b0d341f
7
- data.tar.gz: cc2eb88049270abfb844ebce2fd90d12cd5dcf199815cb98c7286cee7775102cfd447c3fb5e6f053780ec4b1c35c1758f768018b6ae0091404bbacba60176d66
6
+ metadata.gz: 1caebdddbc1576014e3fc3a72335736619d9461768f580f8b8ad0a90e963811041bea3b9b1d3bf5827b7f256f11773a9ed0fd133c513dfd3d6917936b0929980
7
+ data.tar.gz: '09fc4bf3cf5ee8c3581a27871e03c34b13d922e99dc60a5a07c4639c4e0086ed1d560f568bb9a3408908a8361f8d6df1b5f0f7546d304bec526d406be5539c42'
@@ -1,4 +1,3 @@
1
- require 'active_record/log_subscriber'
2
1
  require 'action_controller/log_subscriber'
3
2
 
4
3
  module RailsSemanticLogger
@@ -222,11 +221,15 @@ module RailsSemanticLogger
222
221
 
223
222
  if config.rails_semantic_logger.semantic
224
223
  # Active Record
225
- RailsSemanticLogger.swap_subscriber(
226
- ::ActiveRecord::LogSubscriber,
227
- RailsSemanticLogger::ActiveRecord::LogSubscriber,
228
- :active_record
229
- )
224
+ if defined?(::ActiveRecord)
225
+ require 'active_record/log_subscriber'
226
+
227
+ RailsSemanticLogger.swap_subscriber(
228
+ ::ActiveRecord::LogSubscriber,
229
+ RailsSemanticLogger::ActiveRecord::LogSubscriber,
230
+ :active_record
231
+ )
232
+ end
230
233
 
231
234
  # Rack
232
235
  RailsSemanticLogger::Rack::Logger.started_request_log_level = :info if config.rails_semantic_logger.started
@@ -260,7 +263,13 @@ module RailsSemanticLogger
260
263
  # Passenger provides the :starting_worker_process event for executing
261
264
  # code after it has forked, so we use that and reconnect immediately.
262
265
  if defined?(PhusionPassenger)
263
- PhusionPassenger.on_event(:starting_worker_process) { |forked| ::SemanticLogger.reopen if forked }
266
+ PhusionPassenger.on_event(:starting_worker_process) do |forked|
267
+ if forked
268
+ # Workaround CRuby crash on fork https://github.com/rocketjob/semantic_logger/issues/103
269
+ SemanticLogger::Processor.instance.instance_variable_set(:@queue, Queue.new)
270
+ SemanticLogger.reopen
271
+ end
272
+ end
264
273
  end
265
274
 
266
275
  # Re-open appenders after Resque has forked a worker
@@ -1,3 +1,3 @@
1
1
  module RailsSemanticLogger
2
- VERSION = '4.3.1'.freeze
2
+ VERSION = '4.3.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_semantic_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.3.1
4
+ version: 4.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reid Morrison
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-20 00:00:00.000000000 Z
11
+ date: 2018-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 2.7.6
86
+ rubygems_version: 2.7.7
87
87
  signing_key:
88
88
  specification_version: 4
89
89
  summary: Feature rich logging framework that replaces the Rails logger.