loggun 0.5.1 → 0.6.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: 51f8b307222f4c0cd6a68a2e1190c505dfb85c98916e8bef75f8353308d6066e
4
- data.tar.gz: a967d678e0ca4e52f7dc2f4387d2d04fe7097f10eb0cbfaccfe9c41d6c2de809
3
+ metadata.gz: 8bdbf0283432b32fe9fe682ca29e432480e1bae6cc4ff31879b50a26120b10c9
4
+ data.tar.gz: bce5fe0878cba0d1e758289baa9b2227bfc81a1946443c2b7bfc8ee4580a3267
5
5
  SHA512:
6
- metadata.gz: 29b945bd8b60102ba564177193321458adc9226d6c5eb541be5e8ba06a591d9cef305d2a3c45180c011580b31acb78c6687b87941951268e35525bc5af110311
7
- data.tar.gz: 18894d7473ac6a2700b96e61a1d3f2d5c4ff152546f464d1663b2aa891a6fb559856a99a1fe0b2205cdb83457818091f391ac2e137e9e6027cc72eb6b59b0bc5
6
+ metadata.gz: e8f76f5a5d5244f20d6b3cf5ed1f2c41ef87f93f50ac107626bc6f45cc2a3b44629d6b3d45af61bbd79e424f99ce99f1070937bb97c6e35906c8ea6d2609efd8
7
+ data.tar.gz: 923f02afe9583bbb919671fbeb6fb54e8553efd1a01a6102d2eed865158a21c30c1effdd9e46f836488541b622ac8ae7e5c6ca9bfaa89e43752de40f0827aef3
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.0 - 2020-09-22
4
+ * features
5
+ * Sidekiq client middlware for logging enqueued jobs
6
+
3
7
  ## 0.5.1 - 2020-09-22
4
8
  * fix
5
9
  * `message` string only in `log_format == :json`
@@ -8,6 +8,10 @@ module Loggun
8
8
  def apply
9
9
  return unless defined?(::Sidekiq) && ::Sidekiq::VERSION >= MIN_SIDEKIQ_V
10
10
 
11
+ ::Sidekiq.client_middleware do |chain|
12
+ chain.add ClientMiddleware
13
+ end
14
+
11
15
  ::Sidekiq.configure_server do |config|
12
16
  Loggun::Config.setup_formatter(config, LoggunFormatter.new)
13
17
  end
@@ -20,6 +24,15 @@ module Loggun
20
24
  require 'loggun/modifiers/sidekiq/sidekiq4'
21
25
  end
22
26
  end
27
+
28
+ class ClientMiddleware
29
+ def call(worker_class, _msg, queue, _redis_pool)
30
+ yield.tap do |options|
31
+ msg = "Job #{worker_class} JID-#{options['jid']} enqueued to `#{queue}`"
32
+ Loggun.info('app.sidekiq.enqueued', msg, worker_class: worker_class, jid: options['jid'], queue: queue)
33
+ end
34
+ end
35
+ end
23
36
  end
24
37
  end
25
38
  end
@@ -1,3 +1,3 @@
1
1
  module Loggun
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: loggun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksandr Noskov
8
8
  - Sergey Nesterov
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
12
  date: 2020-09-22 00:00:00.000000000 Z
@@ -168,7 +168,7 @@ licenses:
168
168
  metadata:
169
169
  homepage_uri: https://github.com/funbox/loggun
170
170
  source_code_uri: https://github.com/funbox/loggun
171
- post_install_message:
171
+ post_install_message:
172
172
  rdoc_options: []
173
173
  require_paths:
174
174
  - lib
@@ -183,8 +183,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  - !ruby/object:Gem::Version
184
184
  version: '0'
185
185
  requirements: []
186
- rubygems_version: 3.0.6
187
- signing_key:
186
+ rubygems_version: 3.1.2
187
+ signing_key:
188
188
  specification_version: 4
189
189
  summary: Loggun
190
190
  test_files: []