loga 2.8.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build-and-test.yml +72 -0
  3. data/.github/workflows/publish-gem.yml +28 -0
  4. data/.rubocop.yml +10 -11
  5. data/.rubocop_todo.yml +265 -0
  6. data/Appraisals +83 -22
  7. data/CHANGELOG.md +14 -0
  8. data/Gemfile +24 -0
  9. data/README.md +1 -1
  10. data/gemfiles/rails52.gemfile +23 -1
  11. data/gemfiles/rails60.gemfile +24 -0
  12. data/gemfiles/rails61.gemfile +24 -0
  13. data/gemfiles/rails70.gemfile +27 -0
  14. data/gemfiles/rails71.gemfile +38 -0
  15. data/gemfiles/rails72.gemfile +38 -0
  16. data/gemfiles/rails80.gemfile +38 -0
  17. data/gemfiles/sidekiq51.gemfile +25 -0
  18. data/gemfiles/sidekiq60.gemfile +25 -0
  19. data/gemfiles/sidekiq61.gemfile +25 -0
  20. data/gemfiles/sidekiq62.gemfile +25 -0
  21. data/gemfiles/sidekiq63.gemfile +25 -0
  22. data/gemfiles/sidekiq64.gemfile +25 -0
  23. data/gemfiles/sidekiq65.gemfile +25 -0
  24. data/gemfiles/sidekiq70.gemfile +25 -0
  25. data/gemfiles/sidekiq71.gemfile +25 -0
  26. data/gemfiles/sidekiq72.gemfile +36 -0
  27. data/gemfiles/sidekiq73.gemfile +36 -0
  28. data/gemfiles/sidekiq80.gemfile +36 -0
  29. data/gemfiles/sinatra14.gemfile +25 -0
  30. data/gemfiles/sinatra2.gemfile +36 -0
  31. data/gemfiles/sinatra3.gemfile +36 -0
  32. data/gemfiles/sinatra4.gemfile +36 -0
  33. data/gemfiles/unit.gemfile +24 -0
  34. data/lib/loga/parameter_filter.rb +0 -2
  35. data/lib/loga/rack/request.rb +2 -2
  36. data/lib/loga/rack/request_id.rb +2 -2
  37. data/lib/loga/railtie.rb +3 -3
  38. data/lib/loga/sidekiq.rb +11 -0
  39. data/lib/loga/sidekiq8/job_logger.rb +13 -0
  40. data/lib/loga/tagged_logging.rb +2 -2
  41. data/lib/loga/version.rb +1 -1
  42. data/loga.gemspec +0 -15
  43. data/spec/fixtures/{rails50.rb → rails71.rb} +1 -1
  44. data/spec/fixtures/{rails42.rb → rails72.rb} +3 -3
  45. data/spec/fixtures/rails80.rb +80 -0
  46. data/spec/integration/rails/action_mailer_spec.rb +2 -0
  47. data/spec/integration/rails/railtie_spec.rb +13 -3
  48. data/spec/integration/rails/request_spec.rb +4 -2
  49. data/spec/integration/sidekiq5_spec.rb +15 -13
  50. data/spec/integration/sidekiq60_spec.rb +3 -3
  51. data/spec/integration/sidekiq61_spec.rb +6 -4
  52. data/spec/integration/sidekiq65_spec.rb +1 -1
  53. data/spec/integration/sidekiq8_spec.rb +193 -0
  54. data/spec/integration/sinatra_spec.rb +18 -8
  55. data/spec/loga/sidekiq5/job_logger_spec.rb +2 -0
  56. data/spec/loga/sidekiq6/job_logger_spec.rb +3 -1
  57. data/spec/loga/sidekiq_latest/job_logger_spec.rb +138 -0
  58. data/spec/loga/sidekiq_spec.rb +17 -3
  59. data/spec/spec_helper.rb +14 -5
  60. data/spec/support/gethostname_shared.rb +3 -1
  61. data/spec/support/helpers.rb +10 -0
  62. data/spec/support/request_spec.rb +90 -81
  63. data/spec/support/timecop_shared.rb +3 -1
  64. data/spec/unit/loga/configuration_spec.rb +11 -9
  65. data/spec/unit/loga/event_spec.rb +4 -2
  66. data/spec/unit/loga/formatters/gelf_formatter_spec.rb +22 -14
  67. data/spec/unit/loga/formatters/simple_formatter_spec.rb +27 -10
  68. data/spec/unit/loga/log_subscribers/action_mailer_spec.rb +6 -4
  69. data/spec/unit/loga/parameter_filter_spec.rb +2 -0
  70. data/spec/unit/loga/rack/logger_spec.rb +18 -16
  71. data/spec/unit/loga/rack/request_spec.rb +2 -0
  72. data/spec/unit/loga/service_version_strategies_spec.rb +2 -0
  73. data/spec/unit/loga/utilities_spec.rb +2 -0
  74. data/spec/unit/loga_spec.rb +3 -1
  75. metadata +26 -212
  76. data/.circleci/config.yml +0 -112
  77. data/gemfiles/rails42.gemfile +0 -11
  78. data/gemfiles/rails50.gemfile +0 -11
  79. data/gemfiles/sidekiq7.gemfile +0 -11
  80. data/spec/loga/sidekiq7/job_logger_spec.rb +0 -125
@@ -0,0 +1,36 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "concurrent-ruby", "1.3.4"
6
+ gem "sinatra", "~> 2.2.4"
7
+
8
+ group :development do
9
+ gem "appraisal"
10
+ gem "benchmark"
11
+ gem "bigdecimal"
12
+ gem "bundler", ">= 1.6"
13
+ gem "byebug"
14
+ gem "fakeredis"
15
+ gem "guard-rspec"
16
+ gem "guard-rubocop"
17
+ gem "guard"
18
+ gem "net-imap"
19
+ gem "net-pop"
20
+ gem "net-smtp"
21
+ gem "ostruct"
22
+ gem "pry"
23
+ gem "psych"
24
+ gem "rack-test"
25
+ gem "rake"
26
+ gem "rspec", "~> 3.7"
27
+ gem "rubocop-rspec"
28
+ gem "rubocop"
29
+ gem "timecop"
30
+ end
31
+
32
+ group :test do
33
+ gem "simplecov", "~> 0.17.0"
34
+ end
35
+
36
+ gemspec path: "../"
@@ -0,0 +1,36 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "concurrent-ruby", "1.3.4"
6
+ gem "sinatra", "~> 3.2.0"
7
+
8
+ group :development do
9
+ gem "appraisal"
10
+ gem "benchmark"
11
+ gem "bigdecimal"
12
+ gem "bundler", ">= 1.6"
13
+ gem "byebug"
14
+ gem "fakeredis"
15
+ gem "guard-rspec"
16
+ gem "guard-rubocop"
17
+ gem "guard"
18
+ gem "net-imap"
19
+ gem "net-pop"
20
+ gem "net-smtp"
21
+ gem "ostruct"
22
+ gem "pry"
23
+ gem "psych"
24
+ gem "rack-test"
25
+ gem "rake"
26
+ gem "rspec", "~> 3.7"
27
+ gem "rubocop-rspec"
28
+ gem "rubocop"
29
+ gem "timecop"
30
+ end
31
+
32
+ group :test do
33
+ gem "simplecov", "~> 0.17.0"
34
+ end
35
+
36
+ gemspec path: "../"
@@ -0,0 +1,36 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "concurrent-ruby", "1.3.4"
6
+ gem "sinatra", "~> 4.0.0"
7
+
8
+ group :development do
9
+ gem "appraisal"
10
+ gem "benchmark"
11
+ gem "bigdecimal"
12
+ gem "bundler", ">= 1.6"
13
+ gem "byebug"
14
+ gem "fakeredis"
15
+ gem "guard-rspec"
16
+ gem "guard-rubocop"
17
+ gem "guard"
18
+ gem "net-imap"
19
+ gem "net-pop"
20
+ gem "net-smtp"
21
+ gem "ostruct"
22
+ gem "pry"
23
+ gem "psych"
24
+ gem "rack-test"
25
+ gem "rake"
26
+ gem "rspec", "~> 3.7"
27
+ gem "rubocop-rspec"
28
+ gem "rubocop"
29
+ gem "timecop"
30
+ end
31
+
32
+ group :test do
33
+ gem "simplecov", "~> 0.17.0"
34
+ end
35
+
36
+ gemspec path: "../"
@@ -2,6 +2,30 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ group :development do
6
+ gem "appraisal"
7
+ gem "benchmark"
8
+ gem "bigdecimal"
9
+ gem "bundler", ">= 1.6"
10
+ gem "byebug"
11
+ gem "fakeredis"
12
+ gem "guard-rspec"
13
+ gem "guard-rubocop"
14
+ gem "guard"
15
+ gem "net-imap"
16
+ gem "net-pop"
17
+ gem "net-smtp"
18
+ gem "ostruct"
19
+ gem "pry"
20
+ gem "psych"
21
+ gem "rack-test"
22
+ gem "rake"
23
+ gem "rspec", "~> 3.7"
24
+ gem "rubocop-rspec"
25
+ gem "rubocop"
26
+ gem "timecop"
27
+ end
28
+
5
29
  group :test do
6
30
  gem "simplecov", "~> 0.17.0"
7
31
  end
@@ -20,8 +20,6 @@ module Loga
20
20
 
21
21
  class CompiledFilter
22
22
  def self.compile(filters)
23
- ->(params) { params.dup } if filters.empty?
24
-
25
23
  regexps = []
26
24
  strings = []
27
25
 
@@ -34,12 +34,12 @@ module Loga
34
34
  env['loga.request.original_path']
35
35
  end
36
36
 
37
- # rubocop:disable Metrics/LineLength
37
+ # rubocop:disable Layout/LineLength
38
38
  def filtered_full_path
39
39
  @filtered_full_path ||=
40
40
  query_string.empty? ? original_path : "#{original_path}?#{filtered_query_string}"
41
41
  end
42
- # rubocop:enable Metrics/LineLength
42
+ # rubocop:enable Layout/LineLength
43
43
 
44
44
  def filtered_parameters
45
45
  @filtered_parameters ||= filtered_query_hash.merge(filtered_form_hash)
@@ -3,7 +3,7 @@ require 'securerandom'
3
3
  require 'active_support/core_ext/string/access'
4
4
  require 'active_support/core_ext/object/blank'
5
5
 
6
- # rubocop:disable Lint/AssignmentInCondition, Metrics/LineLength, Style/GuardClause
6
+ # rubocop:disable Lint/AssignmentInCondition, Layout/LineLength, Style/GuardClause
7
7
  module Loga
8
8
  module Rack
9
9
  # Makes a unique request id available to the action_dispatch.request_id env variable (which is then accessible through
@@ -41,4 +41,4 @@ module Loga
41
41
  end
42
42
  end
43
43
  end
44
- # rubocop:enable Lint/AssignmentInCondition, Metrics/LineLength, Style/GuardClause
44
+ # rubocop:enable Lint/AssignmentInCondition, Layout/LineLength, Style/GuardClause
data/lib/loga/railtie.rb CHANGED
@@ -86,10 +86,10 @@ module Loga
86
86
 
87
87
  private
88
88
 
89
- def render_exception_with_loga(arg, exception)
89
+ def render_exception_with_loga(arg, exception, *args)
90
90
  env = arg.is_a?(ActionDispatch::Request) ? arg.env : arg
91
91
  env['loga.exception'] = exception
92
- render_exception_without_loga(arg, exception)
92
+ render_exception_without_loga(arg, exception, *args)
93
93
  end
94
94
  end
95
95
 
@@ -125,7 +125,7 @@ module Loga
125
125
  def silence_rails_rack_logger
126
126
  case Rails::VERSION::MAJOR
127
127
  when 3 then require 'loga/ext/rails/rack/logger3.rb'
128
- when 4..7 then require 'loga/ext/rails/rack/logger.rb'
128
+ when 4..8 then require 'loga/ext/rails/rack/logger.rb'
129
129
  else
130
130
  raise Loga::ConfigurationError,
131
131
  "Rails #{Rails::VERSION::MAJOR} is unsupported"
data/lib/loga/sidekiq.rb CHANGED
@@ -12,6 +12,8 @@ module Loga
12
12
  configure_for_sidekiq6
13
13
  elsif Gem::Version.new(::Sidekiq::VERSION) < Gem::Version.new('8.0')
14
14
  configure_for_sidekiq7
15
+ elsif Gem::Version.new(::Sidekiq::VERSION) < Gem::Version.new('9.0')
16
+ configure_for_sidekiq8
15
17
  end
16
18
  end
17
19
 
@@ -43,5 +45,14 @@ module Loga
43
45
  config.logger = Loga.configuration.logger
44
46
  end
45
47
  end
48
+
49
+ def self.configure_for_sidekiq8
50
+ require 'loga/sidekiq8/job_logger'
51
+
52
+ ::Sidekiq.configure_server do |config|
53
+ config[:job_logger] = Loga::Sidekiq8::JobLogger
54
+ config.logger = Loga.configuration.logger
55
+ end
56
+ end
46
57
  end
47
58
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # If a future Sidekiq 8.x release introduces breaking changes that require a
4
+ # divergent implementation, replace this constant assignment with a dedicated
5
+ # class (you can copy the Sidekiq7 implementation as a starting point).
6
+
7
+ require 'loga/sidekiq7/job_logger'
8
+
9
+ module Loga
10
+ module Sidekiq8
11
+ JobLogger = Class.new(Loga::Sidekiq7::JobLogger)
12
+ end
13
+ end
@@ -8,7 +8,7 @@ require 'active_support/core_ext/object/blank'
8
8
  require 'logger'
9
9
 
10
10
  module Loga
11
- # rubocop:disable Metrics/LineLength
11
+ # rubocop:disable Layout/LineLength
12
12
  # Wraps any standard Logger object to provide tagging capabilities.
13
13
  #
14
14
  # logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
@@ -19,7 +19,7 @@ module Loga
19
19
  # This is used by the default Rails.logger as configured by Railties to make
20
20
  # it easy to stamp log lines with subdomains, request ids, and anything else
21
21
  # to aid debugging of multi-user production applications.
22
- # rubocop:enable Metrics/LineLength
22
+ # rubocop:enable Layout/LineLength
23
23
  module TaggedLogging
24
24
  module Formatter # :nodoc:
25
25
  def tagged(*tags)
data/lib/loga/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Loga
2
- VERSION = '2.8.0'.freeze
2
+ VERSION = '2.9.0'.freeze
3
3
  end
data/loga.gemspec CHANGED
@@ -20,19 +20,4 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency 'activesupport', '>= 2.3.8'
22
22
  spec.add_dependency 'rack'
23
-
24
- spec.add_development_dependency 'appraisal', '~> 2.4'
25
- spec.add_development_dependency 'bundler', '>= 1.6'
26
- spec.add_development_dependency 'byebug'
27
- spec.add_development_dependency 'guard', '~> 2.13'
28
- spec.add_development_dependency 'guard-rspec', '~> 4.7'
29
- spec.add_development_dependency 'guard-rubocop', '~> 1.2'
30
- spec.add_development_dependency 'pry'
31
- spec.add_development_dependency 'rack-test'
32
- spec.add_development_dependency 'rake'
33
- spec.add_development_dependency 'fakeredis'
34
- spec.add_development_dependency 'rspec', '~> 3.7'
35
- spec.add_development_dependency 'rubocop', '~> 0.57.0'
36
- spec.add_development_dependency 'rubocop-rspec'
37
- spec.add_development_dependency 'timecop'
38
23
  end
@@ -9,7 +9,7 @@ class Dummy < Rails::Application
9
9
  config.eager_load = true
10
10
  config.filter_parameters += [:password]
11
11
  config.secret_key_base = '2624599ca9ab3cf3823626240138a128118a87683bf03ab8f155844c33b3cd8cbbfa3ef5e29db6f5bd182f8bd4776209d9577cfb46ac51bfd232b00ab0136b24'
12
- config.session_store :cookie_store, key: '_rails50_session'
12
+ config.session_store :cookie_store, key: '_rails71_session'
13
13
 
14
14
  config.log_tags = [:uuid, 'TEST_TAG']
15
15
  config.loga = {
@@ -9,7 +9,7 @@ class Dummy < Rails::Application
9
9
  config.eager_load = true
10
10
  config.filter_parameters += [:password]
11
11
  config.secret_key_base = '2624599ca9ab3cf3823626240138a128118a87683bf03ab8f155844c33b3cd8cbbfa3ef5e29db6f5bd182f8bd4776209d9577cfb46ac51bfd232b00ab0136b24'
12
- config.session_store :cookie_store, key: '_rails42_session'
12
+ config.session_store :cookie_store, key: '_rails72_session'
13
13
 
14
14
  config.log_tags = [:uuid, 'TEST_TAG']
15
15
  config.loga = {
@@ -23,10 +23,10 @@ end
23
23
 
24
24
  class ApplicationController < ActionController::Base
25
25
  include Rails.application.routes.url_helpers
26
- protect_from_forgery
26
+ protect_from_forgery with: :null_session
27
27
 
28
28
  def ok
29
- render text: 'Hello Rails'
29
+ render plain: 'Hello Rails'
30
30
  end
31
31
 
32
32
  def error
@@ -0,0 +1,80 @@
1
+ require 'action_controller/railtie'
2
+ require 'action_mailer/railtie'
3
+
4
+ Bundler.require(*Rails.groups)
5
+
6
+ STREAM = StringIO.new unless defined?(STREAM)
7
+
8
+ class Dummy < Rails::Application
9
+ config.eager_load = true
10
+ config.filter_parameters += [:password]
11
+ config.secret_key_base = '2624599ca9ab3cf3823626240138a128118a87683bf03ab8f155844c33b3cd8cbbfa3ef5e29db6f5bd182f8bd4776209d9577cfb46ac51bfd232b00ab0136b24'
12
+ config.session_store :cookie_store, key: '_rails80_session'
13
+
14
+ config.log_tags = [:uuid, 'TEST_TAG']
15
+ config.loga = {
16
+ device: STREAM,
17
+ host: 'bird.example.com',
18
+ service_name: 'hello_world_app',
19
+ service_version: '1.0',
20
+ }
21
+ config.action_mailer.delivery_method = :test
22
+ end
23
+
24
+ class ApplicationController < ActionController::Base
25
+ include Rails.application.routes.url_helpers
26
+ protect_from_forgery with: :null_session
27
+
28
+ def ok
29
+ render plain: 'Hello Rails'
30
+ end
31
+
32
+ def error
33
+ nil.name
34
+ end
35
+
36
+ def show
37
+ render json: params
38
+ end
39
+
40
+ def create
41
+ render json: params
42
+ end
43
+
44
+ def new
45
+ redirect_to :ok
46
+ end
47
+
48
+ def update
49
+ @id = params[:id]
50
+ render '/user'
51
+ end
52
+ end
53
+
54
+ class FakeMailer < ActionMailer::Base
55
+ default from: 'notifications@example.com'
56
+
57
+ def self.send_email
58
+ basic_mail.deliver_now
59
+ end
60
+
61
+ def basic_mail
62
+ mail(
63
+ to: 'user@example.com',
64
+ subject: 'Welcome to My Awesome Site',
65
+ body: 'Banana muffin',
66
+ content_type: 'text/html',
67
+ )
68
+ end
69
+ end
70
+
71
+ Dummy.routes.append do
72
+ get 'ok' => 'application#ok'
73
+ get 'error' => 'application#error'
74
+ get 'show' => 'application#show'
75
+ post 'users' => 'application#create'
76
+ get 'new' => 'application#new'
77
+ put 'users/:id' => 'application#update'
78
+ end
79
+
80
+ Dummy.initialize!
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  RSpec.describe Loga::LogSubscribers::ActionMailer, if: Rails.env.production? do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'ostruct'
2
4
 
3
5
  RSpec.describe Loga::Railtie do
@@ -17,7 +19,11 @@ RSpec.describe Loga::Railtie do
17
19
  let(:formatter) { Loga::Formatters::SimpleFormatter }
18
20
 
19
21
  it 'assign Loga logger to Rails logger' do
20
- expect(Loga.logger).to equal(Rails.logger)
22
+ if defined?(ActiveSupport::BroadcastLogger)
23
+ expect(Loga.logger).to be_a(Logger)
24
+ else
25
+ expect(Loga.logger).to equal(Rails.logger)
26
+ end
21
27
  end
22
28
 
23
29
  it 'configures Loga with a simple formatter' do
@@ -29,7 +35,11 @@ RSpec.describe Loga::Railtie do
29
35
  context 'when production', if: Rails.env.production? do
30
36
  describe 'loga_initialize_logger' do
31
37
  it 'assign Loga logger to Rails logger' do
32
- expect(Loga.logger).to equal(Rails.logger)
38
+ if defined?(ActiveSupport::BroadcastLogger)
39
+ expect(Loga.logger).to be_a(Logger)
40
+ else
41
+ expect(Loga.logger).to equal(Rails.logger)
42
+ end
33
43
  end
34
44
 
35
45
  it 'configures Loga with a structured formatter' do
@@ -38,7 +48,7 @@ RSpec.describe Loga::Railtie do
38
48
  end
39
49
 
40
50
  it 'disables colorized logging' do
41
- expect(app.config.colorize_logging).to eq(false)
51
+ expect(app.config.colorize_logging).to be(false)
42
52
  end
43
53
  end
44
54
 
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
 
3
- RSpec.describe 'Structured logging with Rails', timecop: true,
4
- if: Rails.env.production? do
5
+ RSpec.describe 'Structured logging with Rails', :timecop,
6
+ if: Rails.env.production? do
5
7
  let(:app) { Rails.application }
6
8
 
7
9
  let(:log_entries) do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'timecop'
3
5
  require 'fakeredis'
@@ -24,8 +26,8 @@ describe 'Sidekiq client logger' do
24
26
  attr_reader :latest_error, :mutex, :cond
25
27
 
26
28
  def initialize
27
- @mutex = ::Mutex.new
28
- @cond = ::ConditionVariable.new
29
+ @mutex = Mutex.new
30
+ @cond = ConditionVariable.new
29
31
  end
30
32
 
31
33
  def processor_died(_inst, err)
@@ -84,7 +86,7 @@ describe 'Sidekiq client logger' do
84
86
  aggregate_failures do
85
87
  expect(last_element['class']).to eq 'MySidekiqWorker'
86
88
  expect(last_element['args']).to eq ['Bob']
87
- expect(last_element['retry']).to eq true
89
+ expect(last_element['retry']).to be true
88
90
  expect(last_element['queue']).to eq 'default'
89
91
  end
90
92
  end
@@ -107,16 +109,16 @@ describe 'Sidekiq client logger' do
107
109
 
108
110
  aggregate_failures do
109
111
  expect(json_line).to include(
110
- '_queue'=> 'default',
111
- '_retry'=> true,
112
- '_params'=> ['Bob'],
113
- '_class'=> 'MySidekiqWorker',
114
- '_type'=> 'sidekiq',
115
- '_service.name'=> 'hello_world_app',
116
- '_service.version'=> '1.0',
117
- '_tags'=> '',
118
- 'level'=> 6,
119
- 'version'=> '1.1',
112
+ '_queue' => 'default',
113
+ '_retry' => true,
114
+ '_params' => ['Bob'],
115
+ '_class' => 'MySidekiqWorker',
116
+ '_type' => 'sidekiq',
117
+ '_service.name' => 'hello_world_app',
118
+ '_service.version' => '1.0',
119
+ '_tags' => '',
120
+ 'level' => 6,
121
+ 'version' => '1.1',
120
122
  )
121
123
 
122
124
  %w[_created_at _enqueued_at _jid _duration timestamp host].each do |key|
@@ -31,8 +31,8 @@ describe 'Sidekiq client logger' do
31
31
  attr_reader :cond
32
32
 
33
33
  def initialize
34
- @mutex = ::Mutex.new
35
- @cond = ::ConditionVariable.new
34
+ @mutex = Mutex.new
35
+ @cond = ConditionVariable.new
36
36
  end
37
37
 
38
38
  def processor_died(_inst, err)
@@ -103,7 +103,7 @@ describe 'Sidekiq client logger' do
103
103
  aggregate_failures do
104
104
  expect(last_element['class']).to eq 'MySidekiqWorker'
105
105
  expect(last_element['args']).to eq ['Bob']
106
- expect(last_element['retry']).to eq true
106
+ expect(last_element['retry']).to be true
107
107
  expect(last_element['queue']).to eq 'default'
108
108
  end
109
109
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'spec_helper'
2
4
  require 'timecop'
3
5
  require 'fakeredis'
@@ -27,8 +29,8 @@ describe 'Sidekiq client logger' do
27
29
  attr_reader :latest_error, :mutex, :cond
28
30
 
29
31
  def initialize
30
- @mutex = ::Mutex.new
31
- @cond = ::ConditionVariable.new
32
+ @mutex = Mutex.new
33
+ @cond = ConditionVariable.new
32
34
  end
33
35
 
34
36
  def processor_died(_inst, err)
@@ -46,7 +48,7 @@ describe 'Sidekiq client logger' do
46
48
  concurrency: 3,
47
49
  queues: ['default'],
48
50
  job_logger: Loga::Sidekiq6::JobLogger,
49
- }.tap { |opts| opts[:fetch] = ::Sidekiq::BasicFetch.new(opts) }
51
+ }.tap { |opts| opts[:fetch] = Sidekiq::BasicFetch.new(opts) }
50
52
  end
51
53
  end
52
54
  end
@@ -87,7 +89,7 @@ describe 'Sidekiq client logger' do
87
89
  aggregate_failures do
88
90
  expect(last_element['class']).to eq 'MySidekiqWorker'
89
91
  expect(last_element['args']).to eq ['Bob']
90
- expect(last_element['retry']).to eq true
92
+ expect(last_element['retry']).to be true
91
93
  expect(last_element['queue']).to eq 'default'
92
94
  end
93
95
  end
@@ -75,7 +75,7 @@ describe 'Sidekiq client logger' do
75
75
  aggregate_failures do
76
76
  expect(last_element['class']).to eq 'MySidekiqWorker'
77
77
  expect(last_element['args']).to eq ['Bob']
78
- expect(last_element['retry']).to eq true
78
+ expect(last_element['retry']).to be true
79
79
  expect(last_element['queue']).to eq 'default'
80
80
  end
81
81
  end