lorekeeper 2.2.0 → 2.3.1

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: 94314cd2617d7cfc5478a07242e7b006aba90b8f0736e3760c0c143b6149a867
4
- data.tar.gz: 6a959aa730667a1d39b3aeddfd36f0fd666dd5e2851401af157cba7a6db5b407
3
+ metadata.gz: 92b989dbf8ed93f0ef8a14a4c38c96942e34fdfb11c09048bbbe4077c4c0e493
4
+ data.tar.gz: 994f2c997387e2bf60e991b858a7683de6e0e53f21a7868b42844606e2d93a30
5
5
  SHA512:
6
- metadata.gz: 381adbf920503525d566c0c51127f0826feaf20eb644c3cfae82a63b8f601d8c8c7a61f4bcb536589656908fe08758ba2e0e21cfcf643b7bb3896b62dd5d6a01
7
- data.tar.gz: c293f3b312e22b49632a3494f70e7593eff119024826c10d78ab127b9061c04cd2caac95f5511866f7bac8f65cc0cdb2fe90210d9cec352d11aafa799b0d481e
6
+ metadata.gz: 2626986445dd5884ed83d2853e8654be86eced615ab9b82aab90bae74c3e9e6a2e081acb5c8a3afe27143213cc588f331cd35fb5356c0bab5c196c15d2d19052
7
+ data.tar.gz: 28e4416df69d092dffe46ed3317c33ef0e4d893c3484425d45cf7a4ae8bcfa0768f540dbee6969bc92836008ce71c51d029a3f8ee6fab297228d9fa16a74ffdf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 2.3.1
2
+ * Fix MultiLogger to not raise ArgumentError
3
+
4
+ # 2.3.0
5
+ * Add `#write` method support to all loggers
6
+
7
+ # 2.2.1
8
+ * Fix MultiLogger to not raise NoMethodError
9
+
1
10
  # 2.2.0
2
11
  * Remove metaprogramming from MultiLogger
3
12
  * Drop support for Ruby < 2.7.0
@@ -75,6 +75,10 @@ module Lorekeeper
75
75
 
76
76
  # inherited classes probably want to reimplement this
77
77
  def log_data(_severity, message)
78
+ write(message)
79
+ end
80
+
81
+ def write(message)
78
82
  @iodevice.write(message)
79
83
  end
80
84
 
@@ -94,6 +94,10 @@ module Lorekeeper
94
94
  "Lorekeeper JSON logger. IO: #{@file.inspect}"
95
95
  end
96
96
 
97
+ def write(message)
98
+ super(Oj.dump(message, mode: :compat, cache_keys: true, cache_str: 5) << "\n")
99
+ end
100
+
97
101
  private
98
102
 
99
103
  # Some instrumentation libraries pollute the stacktrace and create a large output which may
@@ -148,7 +152,7 @@ module Lorekeeper
148
152
  fields_to_log[TIMESTAMP] = Time.now.utc.strftime(DATE_FORMAT)
149
153
  fields_to_log[LEVEL] = SEVERITY_NAMES_MAP[severity]
150
154
 
151
- @iodevice.write(Oj.dump(fields_to_log, mode: :compat, cache_keys: true, cache_str: 5) << "\n")
155
+ write(fields_to_log)
152
156
  end
153
157
  end
154
158
  end
@@ -19,24 +19,14 @@ module Lorekeeper
19
19
  # Define all common logging methods within Multilogger to avoid NoMethodError
20
20
  def debug(*args, &block); call_loggers(:debug, *args, &block); end
21
21
 
22
- def debug_with_data(*args, &block); call_loggers(:debug, *args, &block); end
23
-
24
22
  def info(*args, &block); call_loggers(:info, *args, &block); end
25
23
 
26
- def info_with_data(*args, &block); call_loggers(:info, *args, &block); end
27
-
28
24
  def warn(*args, &block); call_loggers(:warn, *args, &block); end
29
25
 
30
- def warn_with_data(*args, &block); call_loggers(:warn, *args, &block); end
31
-
32
26
  def error(*args, &block); call_loggers(:error, *args, &block); end
33
27
 
34
- def error_with_data(*args, &block); call_loggers(:error, *args, &block); end
35
-
36
28
  def fatal(*args, &block); call_loggers(:fatal, *args, &block); end
37
29
 
38
- def fatal_with_data(*args, &block); call_loggers(:fatal, *args, &block); end
39
-
40
30
  def write(*args); call_loggers(:write, *args); end
41
31
 
42
32
  def respond_to?(method, all_included: false)
@@ -51,5 +41,9 @@ module Lorekeeper
51
41
  # Then hope for the best taking the first value
52
42
  result.compact.uniq.first
53
43
  end
44
+
45
+ def method_missing(method, *args, &block)
46
+ call_loggers(method, *args, &block)
47
+ end
54
48
  end
55
49
  end
@@ -28,7 +28,7 @@ module Lorekeeper
28
28
  # \e[colorm sets a color \e[0m resets all properties
29
29
  def log_data(severity, message)
30
30
  color = SEVERITY_TO_COLOR_MAP[severity]
31
- @iodevice.write("\e[#{color}m#{message.gsub('\n', "\n").gsub('\t', "\t")}\e[0m\n")
31
+ write("\e[#{color}m#{message.gsub('\n', "\n").gsub('\t', "\t")}\e[0m\n")
32
32
  end
33
33
 
34
34
  def inspect
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Lorekeeper
4
- VERSION = '2.2.0'
4
+ VERSION = '2.3.1'
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: 2.2.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordi Polo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-29 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj