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 +4 -4
- data/CHANGELOG.md +9 -0
- data/lib/lorekeeper/fast_logger.rb +4 -0
- data/lib/lorekeeper/json_logger.rb +5 -1
- data/lib/lorekeeper/multi_logger.rb +4 -10
- data/lib/lorekeeper/simple_logger.rb +1 -1
- data/lib/lorekeeper/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92b989dbf8ed93f0ef8a14a4c38c96942e34fdfb11c09048bbbe4077c4c0e493
|
4
|
+
data.tar.gz: 994f2c997387e2bf60e991b858a7683de6e0e53f21a7868b42844606e2d93a30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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
|
-
|
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
|
-
|
31
|
+
write("\e[#{color}m#{message.gsub('\n', "\n").gsub('\t', "\t")}\e[0m\n")
|
32
32
|
end
|
33
33
|
|
34
34
|
def inspect
|
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: 2.
|
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-
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|