ezlog 0.10.3 → 0.10.5

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: 5a89b74f63f86ae29c07305e46bf13c8947b182e191e47e3f62b7e44871e29b2
4
- data.tar.gz: 4fdfa0f12bd2b3329cedbf07a141bae85d33e4330bf0b09cd1f56dec5222e76d
3
+ metadata.gz: 8cf8a14dd5827637b59bb8873f7ec6cf88c55c804aa3f90ad64990c01813fe62
4
+ data.tar.gz: 569ff4987274909589ed43f98d8c4ae04badf68b28079d0309cb94d9562f2f87
5
5
  SHA512:
6
- metadata.gz: 7b7803f8b7d10219752ec93b7f5a462bc34a299047f7f1216673850d1d59ee4211ed4b459427f8b041e6e6dc937abe7a9b2073aadc97077d15b06a6c4ca708cf
7
- data.tar.gz: 6dac05cf4c985db51560b8191bdb8f33ddfd6645a846d6d5e145184500b9dae8218ca9c9006ff005b2e672373ae4fe8252e2e19e31b356943ad80d85f625fa5c
6
+ metadata.gz: '0983520700a23dc9a6ce4985c141003f5f4229e595e26f38b895fcfa54b89353f1bc8b80aa78219653a56a177c04dcc4b6ab4450bcdc9fccb25c4fe3871d18fb'
7
+ data.tar.gz: f3599b031c970bae384f198a9da8fc5f9a3735a0b9dadfde0688614cdb8f0051a15a7a8a25b090dbd8d2d9119314b3e144de7989b968ed57033b885a9c522791
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ### 0.10.5 (2022-07-06)
2
+
3
+ [Full Changelog](https://github.com/emartech/ezlog/compare/v0.10.4...v0.10.5)
4
+
5
+ * Fix
6
+ * Support newer versions of Sidekiq
7
+
8
+
9
+ ### 0.10.4 (2022-07-06)
10
+
11
+ [Full Changelog](https://github.com/emartech/ezlog/compare/v0.10.3...v0.10.4)
12
+
13
+ * Fix
14
+ * Removed support for "job-specific log level" feature in Sidekiq.
15
+ * Fixed the bug which could result in an `undefined method 'info'` error message.
16
+
17
+ ### 0.10.2 (2022-06-29)
18
+
19
+ [Full Changelog](https://github.com/emartech/ezlog/compare/v0.10.1...v0.10.2)
20
+
21
+ * Features & enhancements
22
+ * Sidekiq 6.5 compatibility
23
+
1
24
  ### 0.10.1 (2022-01-22)
2
25
 
3
26
  [Full Changelog](https://github.com/emartech/ezlog/compare/v0.10.0...v0.10.1)
@@ -5,18 +5,14 @@ module Ezlog
5
5
  class JobLogger
6
6
  include LogContextHelper
7
7
 
8
- def initialize(logger = ::Sidekiq.logger)
9
- @logger = logger
10
- end
11
-
12
8
  def call(job_hash, _queue)
13
9
  within_log_context(JobContext.from_job_hash(job_hash)) do
14
10
  begin
15
- @logger.info "#{job_hash['class']} started"
11
+ logger.info "#{job_hash['class']} started"
16
12
  benchmark { yield }
17
- @logger.info message: "#{job_hash['class']} finished"
13
+ logger.info message: "#{job_hash['class']} finished"
18
14
  rescue Exception
19
- @logger.info message: "#{job_hash['class']} failed"
15
+ logger.info message: "#{job_hash['class']} failed"
20
16
  raise
21
17
  end
22
18
  end
@@ -25,14 +21,7 @@ module Ezlog
25
21
  def with_job_hash_context(_job_hash, &_block)
26
22
  yield
27
23
  end
28
-
29
- def prepare(job_hash, &_block)
30
- old_log_level = @logger.level
31
- @logger.level = job_hash['log_level'] || @logger.level
32
- yield
33
- ensure
34
- @logger.level = old_log_level
35
- end
24
+ alias prepare with_job_hash_context
36
25
 
37
26
  private
38
27
 
@@ -43,6 +32,10 @@ module Ezlog
43
32
  end_time = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
44
33
  add_to_log_context duration_sec: (end_time - start_time).round(3)
45
34
  end
35
+
36
+ def logger
37
+ ::Sidekiq.logger
38
+ end
46
39
  end
47
40
  end
48
41
  end
data/lib/ezlog/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ezlog
2
- VERSION = '0.10.3'
2
+ VERSION = '0.10.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zoltan Ormandi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-06-29 00:00:00.000000000 Z
11
+ date: 2022-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging