lorekeeper 2.2.1 → 2.3.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
  SHA256:
3
- metadata.gz: 614a3b1372eba2d9fe6a56964d25f9048d2b6dde65ac3e135c023cff6af42b99
4
- data.tar.gz: 45a541d7ccfb5f4aae3f0912dfdb69c19eb1dbca1aef86f4d1f33457df7886ec
3
+ metadata.gz: 1b323055eadcf9d776721dbf722fc84a3fa9c17d43fc2e1874d084eb4fab848a
4
+ data.tar.gz: 50329808d64339ccb223eeb8d9e44f3eeeccfbdf8e32bfb746d26db31d5f7123
5
5
  SHA512:
6
- metadata.gz: 1712e531beb4c0d47853c9128ee732bca5a7c21a016418ead6f812923c33207ec3d86543f7e9e69355344d3cdc4f5720f40be17e0563da798cacd8472fdf7725
7
- data.tar.gz: 87ab1d4ae3df8fb09fa148f2d64cf2d87ebf7ab9423dcee06480a0a620f5ce2ec66d483d7a8f42243b0a41fed9c7c1d70670a490f632fc52d0c9fb65cc962fdb
6
+ metadata.gz: '08252a6d8b16fdf22554adb3b2c7b19b4d6c5d36fb154759004a178407b60a82affd2f4950b3b942955013d20464f8ec41d2222f75cc05349fd042e31a728ee5'
7
+ data.tar.gz: c46a95ddabda346971ecdda9039a1b98a0c816be963e5024cdac49461327f557d12d3842345979b54dff8771aca1f2e0b6e5b2046f91ce00d9a889f03f9d5408
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 2.3.0
2
+ * Add `#write` method support to all loggers
3
+
1
4
  # 2.2.1
2
5
  * Fix MultiLogger to not raise NoMethodError
3
6
 
@@ -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
@@ -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.1'
4
+ VERSION = '2.3.0'
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.1
4
+ version: 2.3.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-08-04 00:00:00.000000000 Z
11
+ date: 2022-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj