outlog 0.2.1 → 0.3.0

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: 6320f9fcc91ec06ab58350bb1cef30c3a6c27a2565c554709a20114a6ff65e0a
4
- data.tar.gz: 741fdf09bbc0b8f21fa08ed6b9528922a5bb46fcd41abb19c28fc6c6b685074a
3
+ metadata.gz: 871ce6cdd7fb2c2e8d96a6df23b2e088b84afcb076c6afaec74ff956b91d1d78
4
+ data.tar.gz: 99761ca28845245bb95e9ed603c8835403f2c72924656e74fef98d614f2977ee
5
5
  SHA512:
6
- metadata.gz: 22b58633102eb87d444c190757280565526fd7d56e4b9af8ca209df61647f0bb5ac4fbacc8d4dc0ae07a7b4f2147f1966b265354694daf268cc98ea62d4a7b16
7
- data.tar.gz: 266a1205ebe8e9aca0280fdd8f96311a1b34c03797f5ac61377fda3fc0733c8698a277063a204b3a194ad9eb6d92176d25e9d8b05344fa5bbbc15078f68f9439
6
+ metadata.gz: 31bc69653c7768017bcc5361a62548cf1655a32b2c10a9dbced4292e1f4f615012cd953b8a58c38249c2b2973f6fbf0022ba24959ee1c3ec5a710597513534cb
7
+ data.tar.gz: 5024ebb8625a30f44d716beb39d0b8a523edd0ec8f6cf2c86f2260da6219021d8e5eeb3937164fea00940999f2cec73c29d4dcb8a8d519768dc8a83e607734e1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- outlog (0.1.0)
4
+ outlog (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -7,6 +7,7 @@ require "socket"
7
7
  require "outlog/base_logger"
8
8
  require "outlog/console_logger"
9
9
  require "outlog/json_logger"
10
+ require "outlog/null_logger"
10
11
 
11
12
  module Outlog
12
13
  class Error < StandardError; end
@@ -27,8 +28,19 @@ module Outlog
27
28
  case environment
28
29
  when "development"
29
30
  ::Outlog::ConsoleLogger.new
31
+ when "test"
32
+ ::Outlog::NullLogger.new
30
33
  else
31
34
  ::Outlog::JsonLogger.new
32
35
  end
33
36
  end
37
+
38
+ def with_logger new_logger
39
+ previous_logger = @logger
40
+ @logger = new_logger
41
+ yield
42
+
43
+ ensure
44
+ @logger = previous_logger
45
+ end
34
46
  end
@@ -0,0 +1,7 @@
1
+ module Outlog
2
+ class NullLogger < BaseLogger
3
+ def output _hash
4
+ # no-op
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module Outlog
2
- VERSION = "0.2.1"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JohnnyT
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-15 00:00:00.000000000 Z
11
+ date: 2019-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -73,6 +73,7 @@ files:
73
73
  - lib/outlog/base_logger.rb
74
74
  - lib/outlog/console_logger.rb
75
75
  - lib/outlog/json_logger.rb
76
+ - lib/outlog/null_logger.rb
76
77
  - lib/outlog/version.rb
77
78
  - outlog.gemspec
78
79
  homepage: https://github.com/johnnyt/outlog