lorekeeper 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/lorekeeper/json_logger.rb +8 -0
- data/lib/lorekeeper/multi_logger.rb +4 -0
- data/lib/lorekeeper/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c55a51890aeb4e37eb76876116cf15a7f69ae6ce
|
4
|
+
data.tar.gz: e63c63f99a922787949efa1af265ea6f2aa449e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 481fba6b44301e346c448782014106deb3cdb18a1e524b304a59de2d30f4311c263273d778e959f80efced2f0b7b467ac0336cf6cb872540ab8dbbc5a0dfb24b
|
7
|
+
data.tar.gz: 886c2d166a4b0126406de44fdbe1083a69f93195a8e2ac86caa275a266dae36b5de07f984a7435765ae76880308ec78a5c57e94a3828854736a370efd0b64928
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# 1.4.0
|
2
|
+
Adds '_with_data' to the simple logger so we can display data in the
|
3
|
+
terminal
|
4
|
+
Adds 'respond_to?' to the multilogger so users can check capabilities of
|
5
|
+
the loggers
|
6
|
+
|
1
7
|
# 1.3.1
|
2
8
|
Loggers provide an inspect method to avoid being too noisy on outputs
|
3
9
|
|
@@ -144,6 +144,14 @@ module Lorekeeper
|
|
144
144
|
def inspect
|
145
145
|
"Lorekeeper Simple logger. IO: #{@file.inspect}"
|
146
146
|
end
|
147
|
+
|
148
|
+
# Extending the logger API with methods error_with_data, etc
|
149
|
+
LOGGING_METHODS.each do |method_name|
|
150
|
+
define_method "#{method_name}_with_data", ->(message_param = nil, data = {}, &block) do
|
151
|
+
return true if METHOD_SEVERITY_MAP[method_name] < @level
|
152
|
+
log_data(METHOD_SEVERITY_MAP[method_name], "#{message_param}, data: #{data}")
|
153
|
+
end
|
154
|
+
end
|
147
155
|
end
|
148
156
|
|
149
157
|
|
@@ -15,6 +15,10 @@ module Lorekeeper
|
|
15
15
|
"Lorekeeper multilogger, loggers: #{@loggers.map(&:inspect)}"
|
16
16
|
end
|
17
17
|
|
18
|
+
def respond_to?(method)
|
19
|
+
@loggers.all?{ |logger| logger.respond_to?(method) }
|
20
|
+
end
|
21
|
+
|
18
22
|
def method_missing(method, *args, &block)
|
19
23
|
result = @loggers.map do |logger|
|
20
24
|
logger.public_send(method, *args, &block) if logger.respond_to?(method)
|
data/lib/lorekeeper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lorekeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordi Polo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.5.1
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: Very fast JSON logger
|