buffering_logger 2.0.3 → 2.0.4

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
  SHA1:
3
- metadata.gz: 8fa7fd977ce2384f69fe8c43f5ec0a9b8a65d49f
4
- data.tar.gz: 304a6a02b266ff01c9be3cdcbd14f56bcec533ca
3
+ metadata.gz: 2ec7a39f0dd57757106b2407dc76ee3a51f2efc4
4
+ data.tar.gz: a416626987ce0e312e1c4cd10280f280fbdc10e1
5
5
  SHA512:
6
- metadata.gz: 07a9d3b0caa90abd4c7576424342cc9c5e739f71384caf06e789c97b6c6559a71e9243e18cee2b416bbd708bae38663dab12ebcd714d2c2ac48204b20758581e
7
- data.tar.gz: a86ac7136625e40dba9b1d4b35d7a42a5db5648580a81c6789798663d598938a1047e9a0920443a9ba229a79f035b7ea440ff47612018a7ab6fc44fd55fc5ab7
6
+ metadata.gz: c6c31d2d11a5144ab790dd7eb4a5b71d61a8deb8e785e6e6729fbaa636bce52e1d6f6469096e840790294f05c6a563c9aa39d1dc1197b487624cadf15eaaa4dd
7
+ data.tar.gz: 5783ab6b1107dd7f92f9335a314eb835a49becf524d558b2fe90a146bb140f77ca946d9d48314d0a9391f579e4d00a4c3b8ba963a36920ad0f1511c7df0f291e
@@ -7,6 +7,8 @@ require 'logger'
7
7
  module BufferingLogger
8
8
  class Logger < ::Logger
9
9
 
10
+ attr_reader :raw_log_device
11
+
10
12
  def initialize(logdev, shift_age: 0, shift_size: 1048576)
11
13
  @shift_age, @shift_size = shift_age, shift_size
12
14
  @opened_logdev = false
@@ -19,14 +21,12 @@ module BufferingLogger
19
21
  def logdev=(logdev)
20
22
  @logdev.close if @logdev && @opened_logdev
21
23
 
22
- raw_log_device = LogDevice.new(logdev, shift_age: @shift_age, shift_size: @shift_size)
24
+ @raw_log_device = LogDevice.new(logdev, shift_age: @shift_age, shift_size: @shift_size)
23
25
 
24
26
  # if we opened the logdev then we should close it when we're done
25
- if raw_log_device.dev != logdev
26
- @opened_logdev = true
27
- end
27
+ @opened_logdev = @raw_log_device.dev != logdev
28
28
 
29
- @logdev = Buffer.new(raw_log_device)
29
+ @logdev = Buffer.new(@raw_log_device)
30
30
  end
31
31
 
32
32
  def buffered(transform: nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buffering_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Brough