lorekeeper 2.0.0 → 2.1.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 +3 -0
- data/lib/lorekeeper/simple_logger.rb +22 -7
- 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: b8a5d046cc9e67c4efda44b74aa45acd384a49d58b1ea710799ff072de7b0316
|
4
|
+
data.tar.gz: c095a976184d6456d2605fdebc25ed20e31b992672e066b892b08be201fe70c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76c142c27abbae12ec4e5bde2262ea79f962f0e5aa9ac6074c04fdf7b84cdc3d5c62cdfdaae45874589d53300de2ddc961657562d9abffbbec8501575ae9f2d6
|
7
|
+
data.tar.gz: 3e86217440ba8269f05c1a1ec44bc4262067a9608ee7caab4a35cfc222a8870a2e7bfbb51dd275ea42ee7169cc033d79ee692dd469f5e16b9a21ae04af348803
|
data/CHANGELOG.md
CHANGED
@@ -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}\e[0m\n")
|
31
|
+
@iodevice.write("\e[#{color}m#{message.gsub('\n', "\n").gsub('\t', "\t")}\e[0m\n")
|
32
32
|
end
|
33
33
|
|
34
34
|
def inspect
|
@@ -43,16 +43,31 @@ module Lorekeeper
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
# To not raise NoMethodError for the methods defined in JSONLogger
|
47
|
+
def current_fields(*); end
|
48
|
+
def state(*); end
|
49
|
+
def add_thread_unsafe_fields(*); end
|
50
|
+
def remove_thread_unsafe_fields(*); end
|
51
|
+
def add_fields(*); end
|
52
|
+
def remove_fields(*); end
|
53
|
+
|
54
|
+
def exception(exception, custom_message = nil, custom_data = nil, custom_level = :error,
|
55
|
+
message: nil, data: nil, level: nil)
|
56
|
+
|
57
|
+
param_level = level || custom_level
|
58
|
+
param_data = data || custom_data
|
59
|
+
param_message = message || custom_message
|
60
|
+
|
61
|
+
log_level = METHOD_SEVERITY_MAP[param_level] || ERROR
|
48
62
|
|
49
63
|
if exception.is_a?(Exception)
|
50
|
-
|
51
|
-
|
52
|
-
|
64
|
+
message = param_message || exception.message
|
65
|
+
backtrace = "\n\nstack:\n#{exception.backtrace.join("\n")}" if exception.backtrace
|
66
|
+
data = "\n\ndata:\n#{param_data}" if param_data
|
67
|
+
log_data(log_level, "#{exception.class}: #{exception.message}; #{message} #{backtrace} #{data}")
|
53
68
|
else
|
54
69
|
log_data(METHOD_SEVERITY_MAP[:warn], 'Logger exception called without exception class.')
|
55
|
-
error_with_data("#{exception.class}: #{exception.inspect} #{
|
70
|
+
error_with_data("#{exception.class}: #{exception.inspect} #{param_message}", param_data)
|
56
71
|
end
|
57
72
|
end
|
58
73
|
end
|
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.1.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: 2022-05-
|
11
|
+
date: 2022-05-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|