logjam_agent 0.38.0 → 0.38.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logjam_agent/buffered_logger.rb +1 -0
- data/lib/logjam_agent/version.rb +1 -1
- data/lib/logjam_agent/zmq_forwarder.rb +1 -1
- data/test/json_logging_test.rb +17 -0
- data/test/test_helper.rb +5 -0
- data/test/zmq_forwarder_test.rb +15 -0
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 623b528c086e5359f9824c6ed231207340d9abc8fb1046f2763200404e9c3ee9
|
4
|
+
data.tar.gz: 0d7de9ffac6e355314388c15c9e6fb0d18f1c5ad723dce7c9b19ef64a864fa1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24d13d8931fc1a3ff1ec13a0617f941798719ccb9cec724d2934f0b80fc7365027029996b867194b60d780589fbfc7b8f391102d16cca28b7b9a5f6fda2668ae
|
7
|
+
data.tar.gz: c130018a95950bb0dfe32afe866f9ce891685ed37edd845b96f76fbe0c97b869bbcb08ba185a9b7f028b3eb9ff98a0a2a7f360a4292efcdb6d840b01a0e0c29e
|
data/lib/logjam_agent/version.rb
CHANGED
data/test/json_logging_test.rb
CHANGED
@@ -100,5 +100,22 @@ module LogjamAgent
|
|
100
100
|
assert_match(/ERROR -- : RuntimeError\(murks\):(\n.*\.rb:\d+:in\s.*)+/, @device.lines.first)
|
101
101
|
end
|
102
102
|
|
103
|
+
def test_can_log_arrays_as_text
|
104
|
+
LogjamAgent.log_format = :text
|
105
|
+
@logger.error([1, 2])
|
106
|
+
assert_equal 1, @lines.size
|
107
|
+
assert_equal([1, 2].to_s, @lines.first.last)
|
108
|
+
assert_equal 1, @device.lines.size
|
109
|
+
assert_match(/ERROR -- : \[1, 2\]\n/, @device.lines.first)
|
110
|
+
end
|
111
|
+
|
112
|
+
def test_can_log_arrays_as_json
|
113
|
+
LogjamAgent.log_format = :json
|
114
|
+
@logger.error([1, 2])
|
115
|
+
assert_equal 1, @lines.size
|
116
|
+
assert_equal([1, 2].to_s, @lines.first.last)
|
117
|
+
assert_equal 1, @device.lines.size
|
118
|
+
assert_match(/ERROR -- : \{"message":"\[1, 2\]"\}\n/, @device.lines.first)
|
119
|
+
end
|
103
120
|
end
|
104
121
|
end
|
data/test/test_helper.rb
CHANGED
data/test/zmq_forwarder_test.rb
CHANGED
@@ -58,5 +58,20 @@ module LogjamAgent
|
|
58
58
|
f.forward(data, :routing_key => "x", :app_env => "a-b")
|
59
59
|
end
|
60
60
|
|
61
|
+
test "can log forwarding warnings if error_handler is defined" do
|
62
|
+
msg = nil
|
63
|
+
LogjamAgent.expects(:error_handler).returns(->(m){ msg = m})
|
64
|
+
ZMQForwarder.new.__send__(:log_warning, "xxx")
|
65
|
+
assert_instance_of ForwardingWarning, msg
|
66
|
+
assert_equal "xxx", msg.message
|
67
|
+
end
|
68
|
+
|
69
|
+
test "does not log forwading warnings if error_handler is nil" do
|
70
|
+
msg = nil
|
71
|
+
LogjamAgent.expects(:error_handler).returns(nil)
|
72
|
+
ZMQForwarder.new.__send__(:log_warning, "xxx")
|
73
|
+
assert_nil msg
|
74
|
+
end
|
75
|
+
|
61
76
|
end
|
62
77
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.38.
|
4
|
+
version: 0.38.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Kaes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: simplecov
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: activesupport
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -280,18 +294,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
294
|
- !ruby/object:Gem::Version
|
281
295
|
version: '0'
|
282
296
|
requirements: []
|
283
|
-
rubygems_version: 3.3.
|
297
|
+
rubygems_version: 3.3.26
|
284
298
|
signing_key:
|
285
299
|
specification_version: 4
|
286
300
|
summary: Logjam client library to be used with logjam
|
287
301
|
test_files:
|
288
|
-
- test/
|
302
|
+
- test/json_logging_test.rb
|
303
|
+
- test/request_test.rb
|
289
304
|
- test/selective_logging_test.rb
|
290
|
-
- test/
|
305
|
+
- test/sinatra_app.rb
|
291
306
|
- test/sinatra_classic_app.rb
|
292
|
-
- test/
|
293
|
-
- test/zmq_forwarder_test.rb
|
294
|
-
- test/util_test.rb
|
295
|
-
- test/test_helper.rb
|
296
|
-
- test/json_logging_test.rb
|
307
|
+
- test/sinatra_classic_test.rb
|
297
308
|
- test/sinatra_test.rb
|
309
|
+
- test/test_helper.rb
|
310
|
+
- test/util_test.rb
|
311
|
+
- test/zmq_forwarder_test.rb
|