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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/outlog.rb +12 -0
- data/lib/outlog/null_logger.rb +7 -0
- data/lib/outlog/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 871ce6cdd7fb2c2e8d96a6df23b2e088b84afcb076c6afaec74ff956b91d1d78
|
4
|
+
data.tar.gz: 99761ca28845245bb95e9ed603c8835403f2c72924656e74fef98d614f2977ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31bc69653c7768017bcc5361a62548cf1655a32b2c10a9dbced4292e1f4f615012cd953b8a58c38249c2b2973f6fbf0022ba24959ee1c3ec5a710597513534cb
|
7
|
+
data.tar.gz: 5024ebb8625a30f44d716beb39d0b8a523edd0ec8f6cf2c86f2260da6219021d8e5eeb3937164fea00940999f2cec73c29d4dcb8a8d519768dc8a83e607734e1
|
data/Gemfile.lock
CHANGED
data/lib/outlog.rb
CHANGED
@@ -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
|
data/lib/outlog/version.rb
CHANGED
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.
|
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-
|
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
|