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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e883e332d3819a40caeecf907cdfad9d8ae3bfe9
4
- data.tar.gz: 49b9d5aa078a5993dcbdeca154e085e2e9f0e6f0
3
+ metadata.gz: c55a51890aeb4e37eb76876116cf15a7f69ae6ce
4
+ data.tar.gz: e63c63f99a922787949efa1af265ea6f2aa449e2
5
5
  SHA512:
6
- metadata.gz: 52e39e1aea389a5f13bfcb370c6832d8f57abc3dbabc4253ed157c5b03c9b97d58737440127098de1b7bb89099454e08c70357fb077a2c6d5d90e820a37e7f31
7
- data.tar.gz: 491b6d0007bfdfaa8c105a98d99257cf78d9dc03140414b34272af2db13c8c3f7c3e70b4b099b25d83e4088e3597419d112fac24e927d4b22f519bc9c707b796
6
+ metadata.gz: 481fba6b44301e346c448782014106deb3cdb18a1e524b304a59de2d30f4311c263273d778e959f80efced2f0b7b467ac0336cf6cb872540ab8dbbc5a0dfb24b
7
+ data.tar.gz: 886c2d166a4b0126406de44fdbe1083a69f93195a8e2ac86caa275a266dae36b5de07f984a7435765ae76880308ec78a5c57e94a3828854736a370efd0b64928
@@ -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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
  # The comment above will make all strings in a current file frozen
3
3
  module Lorekeeper
4
- VERSION = '1.3.1'.freeze
4
+ VERSION = '1.4.0'.freeze
5
5
  end
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.3.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-03-08 00:00:00.000000000 Z
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.4.8
169
+ rubygems_version: 2.5.1
170
170
  signing_key:
171
171
  specification_version: 4
172
172
  summary: Very fast JSON logger