logjam_agent 0.38.1 → 0.38.2

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: 47422acd5b4e45b015b0409e1c92cbe469fe883f6d7ae92eaa213434822f460c
4
- data.tar.gz: 204958e60d5036f5d63c779b7af46dd2705aa6a0ba2be0145bb7c8780c72b849
3
+ metadata.gz: 623b528c086e5359f9824c6ed231207340d9abc8fb1046f2763200404e9c3ee9
4
+ data.tar.gz: 0d7de9ffac6e355314388c15c9e6fb0d18f1c5ad723dce7c9b19ef64a864fa1c
5
5
  SHA512:
6
- metadata.gz: b55dd07ab0d558ca83236a7971d7cd45116418b026ecf8bb9bc05fb435facd5896584f1f8f9d9e4cc657571001ed2613a4bbadcbd12c253af07cbf96fbba30bb
7
- data.tar.gz: 53288566b7cb06d28a5129f71b4bc236569f0f259595ad14a603baa07085d93ebb25ac031e634096206409ec4b0da6b2d4e332f1ff8dfece3ddf89818eb01d23
6
+ metadata.gz: 24d13d8931fc1a3ff1ec13a0617f941798719ccb9cec724d2934f0b80fc7365027029996b867194b60d780589fbfc7b8f391102d16cca28b7b9a5f6fda2668ae
7
+ data.tar.gz: c130018a95950bb0dfe32afe866f9ce891685ed37edd845b96f76fbe0c97b869bbcb08ba185a9b7f028b3eb9ff98a0a2a7f360a4292efcdb6d840b01a0e0c29e
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.38.1"
2
+ VERSION = "0.38.2"
3
3
  end
@@ -125,7 +125,7 @@ module LogjamAgent
125
125
  end
126
126
 
127
127
  def log_warning(message)
128
- LogjamAgent.error_handler.call ForwardingWarning.new(message)
128
+ LogjamAgent.error_handler&.call ForwardingWarning.new(message)
129
129
  end
130
130
 
131
131
  VALID_RESPONSE_CODES = [200,202]
data/test/test_helper.rb CHANGED
@@ -1,3 +1,8 @@
1
+ require 'simplecov'
2
+ SimpleCov.start do
3
+ add_filter %r{^/test/}
4
+ end
5
+
1
6
  require 'minitest/autorun'
2
7
  require 'minitest/unit'
3
8
  require 'minitest/pride' if ENV['RAINBOW_COLORED_TESTS'] == "1" && $stdout.tty?
@@ -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.1
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-14 00:00:00.000000000 Z
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.19
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/sinatra_app.rb
302
+ - test/json_logging_test.rb
303
+ - test/request_test.rb
289
304
  - test/selective_logging_test.rb
290
- - test/sinatra_classic_test.rb
305
+ - test/sinatra_app.rb
291
306
  - test/sinatra_classic_app.rb
292
- - test/request_test.rb
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