loga 2.8.0 → 2.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build-and-test.yml +72 -0
- data/.github/workflows/publish-gem.yml +28 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +206 -0
- data/Appraisals +58 -46
- data/CHANGELOG.md +6 -0
- data/Gemfile +22 -0
- data/gemfiles/rails52.gemfile +23 -1
- data/gemfiles/rails60.gemfile +22 -0
- data/gemfiles/rails61.gemfile +22 -0
- data/gemfiles/rails70.gemfile +24 -0
- data/gemfiles/rails71.gemfile +35 -0
- data/gemfiles/sidekiq51.gemfile +22 -0
- data/gemfiles/sidekiq60.gemfile +22 -0
- data/gemfiles/sidekiq61.gemfile +22 -0
- data/gemfiles/sidekiq62.gemfile +22 -0
- data/gemfiles/sidekiq63.gemfile +22 -0
- data/gemfiles/sidekiq64.gemfile +22 -0
- data/gemfiles/sidekiq65.gemfile +22 -0
- data/gemfiles/sidekiq7.gemfile +22 -0
- data/gemfiles/sidekiq70.gemfile +22 -0
- data/gemfiles/sidekiq71.gemfile +22 -0
- data/gemfiles/sinatra14.gemfile +22 -0
- data/gemfiles/sinatra2.gemfile +33 -0
- data/gemfiles/sinatra3.gemfile +33 -0
- data/gemfiles/sinatra4.gemfile +33 -0
- data/gemfiles/unit.gemfile +22 -0
- data/lib/loga/railtie.rb +2 -2
- data/lib/loga/version.rb +1 -1
- data/loga.gemspec +0 -15
- data/spec/fixtures/{rails50.rb → rails71.rb} +1 -1
- data/spec/integration/rails/action_mailer_spec.rb +2 -0
- data/spec/integration/rails/railtie_spec.rb +13 -3
- data/spec/integration/rails/request_spec.rb +4 -2
- data/spec/integration/sidekiq5_spec.rb +15 -13
- data/spec/integration/sidekiq60_spec.rb +3 -3
- data/spec/integration/sidekiq61_spec.rb +6 -4
- data/spec/integration/sidekiq65_spec.rb +1 -1
- data/spec/integration/sinatra_spec.rb +9 -6
- data/spec/loga/sidekiq5/job_logger_spec.rb +2 -0
- data/spec/loga/sidekiq6/job_logger_spec.rb +3 -1
- data/spec/loga/sidekiq7/job_logger_spec.rb +3 -1
- data/spec/loga/sidekiq_spec.rb +4 -2
- data/spec/spec_helper.rb +6 -3
- data/spec/support/gethostname_shared.rb +3 -1
- data/spec/support/helpers.rb +2 -0
- data/spec/support/request_spec.rb +83 -81
- data/spec/support/timecop_shared.rb +3 -1
- data/spec/unit/loga/configuration_spec.rb +11 -9
- data/spec/unit/loga/event_spec.rb +4 -2
- data/spec/unit/loga/formatters/gelf_formatter_spec.rb +15 -13
- data/spec/unit/loga/formatters/simple_formatter_spec.rb +7 -5
- data/spec/unit/loga/log_subscribers/action_mailer_spec.rb +6 -4
- data/spec/unit/loga/parameter_filter_spec.rb +2 -0
- data/spec/unit/loga/rack/logger_spec.rb +18 -16
- data/spec/unit/loga/rack/request_spec.rb +2 -0
- data/spec/unit/loga/service_version_strategies_spec.rb +2 -0
- data/spec/unit/loga/utilities_spec.rb +2 -0
- data/spec/unit/loga_spec.rb +3 -1
- metadata +12 -206
- data/.circleci/config.yml +0 -112
- data/gemfiles/rails42.gemfile +0 -11
- data/gemfiles/rails50.gemfile +0 -11
- data/spec/fixtures/rails42.rb +0 -80
data/gemfiles/sidekiq60.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 6.0.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq61.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 6.1.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq62.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 6.2.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq63.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 6.3.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq64.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 6.4.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq65.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 6.5.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq7.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 7.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq70.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 7.0.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sidekiq71.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sidekiq", "~> 7.1.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
data/gemfiles/sinatra14.gemfile
CHANGED
@@ -4,6 +4,28 @@ source "https://rubygems.org"
|
|
4
4
|
|
5
5
|
gem "sinatra", "~> 1.4.0"
|
6
6
|
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
7
29
|
group :test do
|
8
30
|
gem "simplecov", "~> 0.17.0"
|
9
31
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "sinatra", "~> 2.2.4"
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
29
|
+
group :test do
|
30
|
+
gem "simplecov", "~> 0.17.0"
|
31
|
+
end
|
32
|
+
|
33
|
+
gemspec path: "../"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "sinatra", "~> 3.2.0"
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
29
|
+
group :test do
|
30
|
+
gem "simplecov", "~> 0.17.0"
|
31
|
+
end
|
32
|
+
|
33
|
+
gemspec path: "../"
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "sinatra", "~> 4.0.0"
|
6
|
+
|
7
|
+
group :development do
|
8
|
+
gem "appraisal"
|
9
|
+
gem "bundler", ">= 1.6"
|
10
|
+
gem "byebug"
|
11
|
+
gem "guard"
|
12
|
+
gem "guard-rspec"
|
13
|
+
gem "guard-rubocop"
|
14
|
+
gem "pry"
|
15
|
+
gem "rack-test"
|
16
|
+
gem "rake"
|
17
|
+
gem "fakeredis"
|
18
|
+
gem "rspec", "~> 3.7"
|
19
|
+
gem "rubocop"
|
20
|
+
gem "rubocop-rspec"
|
21
|
+
gem "timecop"
|
22
|
+
gem "psych"
|
23
|
+
gem "net-smtp"
|
24
|
+
gem "net-pop"
|
25
|
+
gem "net-imap"
|
26
|
+
gem "bigdecimal"
|
27
|
+
end
|
28
|
+
|
29
|
+
group :test do
|
30
|
+
gem "simplecov", "~> 0.17.0"
|
31
|
+
end
|
32
|
+
|
33
|
+
gemspec path: "../"
|
data/gemfiles/unit.gemfile
CHANGED
@@ -2,6 +2,28 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
+
group :development do
|
6
|
+
gem "appraisal"
|
7
|
+
gem "bundler", ">= 1.6"
|
8
|
+
gem "byebug"
|
9
|
+
gem "guard"
|
10
|
+
gem "guard-rspec"
|
11
|
+
gem "guard-rubocop"
|
12
|
+
gem "pry"
|
13
|
+
gem "rack-test"
|
14
|
+
gem "rake"
|
15
|
+
gem "fakeredis"
|
16
|
+
gem "rspec", "~> 3.7"
|
17
|
+
gem "rubocop"
|
18
|
+
gem "rubocop-rspec"
|
19
|
+
gem "timecop"
|
20
|
+
gem "psych"
|
21
|
+
gem "net-smtp"
|
22
|
+
gem "net-pop"
|
23
|
+
gem "net-imap"
|
24
|
+
gem "bigdecimal"
|
25
|
+
end
|
26
|
+
|
5
27
|
group :test do
|
6
28
|
gem "simplecov", "~> 0.17.0"
|
7
29
|
end
|
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
|
|
data/lib/loga/version.rb
CHANGED
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: '
|
12
|
+
config.session_store :cookie_store, key: '_rails70_session'
|
13
13
|
|
14
14
|
config.log_tags = [:uuid, 'TEST_TAG']
|
15
15
|
config.loga = {
|
@@ -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
|
-
|
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
|
-
|
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
|
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
|
4
|
-
|
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 =
|
28
|
-
@cond =
|
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
|
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 =
|
35
|
-
@cond =
|
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
|
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 =
|
31
|
-
@cond =
|
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] =
|
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
|
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
|
78
|
+
expect(last_element['retry']).to be true
|
79
79
|
expect(last_element['queue']).to eq 'default'
|
80
80
|
end
|
81
81
|
end
|