logjam_agent 0.5.3 → 0.5.4

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.
@@ -12,13 +12,12 @@ module LogjamAgent
12
12
  initializer "initialize_logjam_agent_logger", :before => :initialize_logger do |app|
13
13
  Rails.logger ||= app.config.logger ||
14
14
  begin
15
- rails_version = Rails::VERSION::STRING
16
15
  paths = app.config.paths
17
- path = (rails_version < "3.1" ? paths.log.to_a : paths['log']).first.to_s
16
+ path = (Rails::VERSION::STRING < "3.1" ? paths.log.to_a : paths['log']).first.to_s
18
17
  logger = LogjamAgent::BufferedLogger.new(path)
19
18
  logger.level = ActiveSupport::BufferedLogger.const_get(app.config.log_level.to_s.upcase)
20
19
  logger.formatter = LogjamAgent::SyslogLikeFormatter.new
21
- logger.auto_flushing = false if Rails.env.production? && rails_version < "3.2"
20
+ logger.auto_flushing = false if Rails.env.production? && Rails::VERSION::STRING < "3.2"
22
21
  logger
23
22
  rescue StandardError => e
24
23
  logger = LogjamAgent::BufferedLogger.new(STDERR)
@@ -29,6 +28,9 @@ module LogjamAgent
29
28
  )
30
29
  logger
31
30
  end
31
+ if Rails::VERSION::STRING < "3.2"
32
+ at_exit { Rails.logger.flush if Rails.logger.respond_to?(:flush) }
33
+ end
32
34
  end
33
35
 
34
36
  initializer "logjam_agent", :after => "time_bandits" do |app|
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 3
10
- version: 0.5.3
9
+ - 4
10
+ version: 0.5.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stefan Kaes
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-19 00:00:00 Z
18
+ date: 2012-09-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake