loga 2.1.2 → 2.2.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 (142) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +157 -0
  3. data/.codeclimate.yml +4 -0
  4. data/.gitignore +2 -0
  5. data/.rubocop.yml +13 -8
  6. data/Appraisals +16 -6
  7. data/CHANGELOG.md +7 -0
  8. data/Gemfile +0 -1
  9. data/Guardfile +8 -6
  10. data/README.md +1 -0
  11. data/Rakefile +1 -1
  12. data/gemfiles/rails32.gemfile +1 -2
  13. data/gemfiles/rails40.gemfile +1 -2
  14. data/gemfiles/rails42.gemfile +11 -0
  15. data/gemfiles/rails50.gemfile +1 -2
  16. data/gemfiles/rails52.gemfile +11 -0
  17. data/gemfiles/sinatra14.gemfile +1 -2
  18. data/gemfiles/unit.gemfile +1 -2
  19. data/lib/loga.rb +4 -2
  20. data/lib/loga/configuration.rb +5 -5
  21. data/lib/loga/ext/rails/rack/debug_exceptions.rb +1 -2
  22. data/lib/loga/formatters/simple_formatter.rb +1 -1
  23. data/lib/loga/log_subscribers/action_mailer.rb +59 -0
  24. data/lib/loga/rack/logger.rb +1 -1
  25. data/lib/loga/rack/request_id.rb +2 -2
  26. data/lib/loga/railtie.rb +22 -9
  27. data/lib/loga/version.rb +1 -1
  28. data/loga.gemspec +9 -8
  29. data/spec/fixtures/README.md +23 -3
  30. data/spec/fixtures/rails32.rb +79 -0
  31. data/spec/fixtures/rails40.rb +80 -0
  32. data/spec/fixtures/rails42.rb +80 -0
  33. data/spec/fixtures/rails50.rb +80 -0
  34. data/spec/fixtures/rails52.rb +80 -0
  35. data/spec/integration/rails/action_mailer_spec.rb +63 -0
  36. data/spec/integration/rails/railtie_spec.rb +15 -0
  37. data/spec/integration/sinatra_spec.rb +2 -2
  38. data/spec/spec_helper.rb +7 -8
  39. data/spec/support/gethostname_shared.rb +7 -0
  40. data/spec/support/helpers.rb +0 -4
  41. data/spec/unit/loga/configuration_spec.rb +4 -4
  42. data/spec/unit/loga/formatters/gelf_formatter_spec.rb +1 -1
  43. data/spec/unit/loga/formatters/simple_formatter_spec.rb +2 -2
  44. data/spec/unit/loga/log_subscribers/action_mailer_spec.rb +69 -0
  45. data/spec/unit/loga/rack/logger_spec.rb +1 -1
  46. data/spec/unit/loga_spec.rb +1 -1
  47. metadata +71 -225
  48. data/circle.yml +0 -23
  49. data/spec/fixtures/rails32/Rakefile +0 -7
  50. data/spec/fixtures/rails32/app/controllers/application_controller.rb +0 -28
  51. data/spec/fixtures/rails32/app/helpers/application_helper.rb +0 -2
  52. data/spec/fixtures/rails32/app/views/layouts/application.html.erb +0 -14
  53. data/spec/fixtures/rails32/app/views/user.html.erb +0 -1
  54. data/spec/fixtures/rails32/config.ru +0 -4
  55. data/spec/fixtures/rails32/config/application.rb +0 -71
  56. data/spec/fixtures/rails32/config/boot.rb +0 -6
  57. data/spec/fixtures/rails32/config/environment.rb +0 -5
  58. data/spec/fixtures/rails32/config/environments/development.rb +0 -26
  59. data/spec/fixtures/rails32/config/environments/production.rb +0 -50
  60. data/spec/fixtures/rails32/config/environments/test.rb +0 -35
  61. data/spec/fixtures/rails32/config/initializers/backtrace_silencers.rb +0 -7
  62. data/spec/fixtures/rails32/config/initializers/inflections.rb +0 -15
  63. data/spec/fixtures/rails32/config/initializers/mime_types.rb +0 -5
  64. data/spec/fixtures/rails32/config/initializers/secret_token.rb +0 -7
  65. data/spec/fixtures/rails32/config/initializers/session_store.rb +0 -8
  66. data/spec/fixtures/rails32/config/initializers/wrap_parameters.rb +0 -10
  67. data/spec/fixtures/rails32/config/locales/en.yml +0 -5
  68. data/spec/fixtures/rails32/config/routes.rb +0 -64
  69. data/spec/fixtures/rails32/public/404.html +0 -26
  70. data/spec/fixtures/rails32/public/422.html +0 -26
  71. data/spec/fixtures/rails32/public/500.html +0 -25
  72. data/spec/fixtures/rails32/public/favicon.ico +0 -0
  73. data/spec/fixtures/rails32/public/index.html +0 -241
  74. data/spec/fixtures/rails32/public/robots.txt +0 -5
  75. data/spec/fixtures/rails32/script/rails +0 -6
  76. data/spec/fixtures/rails40/Rakefile +0 -6
  77. data/spec/fixtures/rails40/app/controllers/application_controller.rb +0 -30
  78. data/spec/fixtures/rails40/app/helpers/application_helper.rb +0 -2
  79. data/spec/fixtures/rails40/app/views/layouts/application.html.erb +0 -14
  80. data/spec/fixtures/rails40/app/views/user.html.erb +0 -1
  81. data/spec/fixtures/rails40/bin/bundle +0 -3
  82. data/spec/fixtures/rails40/bin/rails +0 -4
  83. data/spec/fixtures/rails40/bin/rake +0 -4
  84. data/spec/fixtures/rails40/config.ru +0 -4
  85. data/spec/fixtures/rails40/config/application.rb +0 -37
  86. data/spec/fixtures/rails40/config/boot.rb +0 -4
  87. data/spec/fixtures/rails40/config/environment.rb +0 -5
  88. data/spec/fixtures/rails40/config/environments/development.rb +0 -24
  89. data/spec/fixtures/rails40/config/environments/production.rb +0 -65
  90. data/spec/fixtures/rails40/config/environments/test.rb +0 -39
  91. data/spec/fixtures/rails40/config/initializers/backtrace_silencers.rb +0 -7
  92. data/spec/fixtures/rails40/config/initializers/filter_parameter_logging.rb +0 -4
  93. data/spec/fixtures/rails40/config/initializers/inflections.rb +0 -16
  94. data/spec/fixtures/rails40/config/initializers/mime_types.rb +0 -5
  95. data/spec/fixtures/rails40/config/initializers/secret_token.rb +0 -12
  96. data/spec/fixtures/rails40/config/initializers/session_store.rb +0 -3
  97. data/spec/fixtures/rails40/config/initializers/wrap_parameters.rb +0 -9
  98. data/spec/fixtures/rails40/config/locales/en.yml +0 -23
  99. data/spec/fixtures/rails40/config/routes.rb +0 -62
  100. data/spec/fixtures/rails40/public/404.html +0 -58
  101. data/spec/fixtures/rails40/public/422.html +0 -58
  102. data/spec/fixtures/rails40/public/500.html +0 -57
  103. data/spec/fixtures/rails40/public/favicon.ico +0 -0
  104. data/spec/fixtures/rails40/public/robots.txt +0 -5
  105. data/spec/fixtures/rails50/Rakefile +0 -6
  106. data/spec/fixtures/rails50/app/controllers/application_controller.rb +0 -28
  107. data/spec/fixtures/rails50/app/helpers/application_helper.rb +0 -2
  108. data/spec/fixtures/rails50/app/views/layouts/application.html.erb +0 -13
  109. data/spec/fixtures/rails50/app/views/user.html.erb +0 -1
  110. data/spec/fixtures/rails50/bin/bundle +0 -3
  111. data/spec/fixtures/rails50/bin/rails +0 -4
  112. data/spec/fixtures/rails50/bin/rake +0 -4
  113. data/spec/fixtures/rails50/bin/setup +0 -34
  114. data/spec/fixtures/rails50/bin/update +0 -29
  115. data/spec/fixtures/rails50/config.ru +0 -5
  116. data/spec/fixtures/rails50/config/application.rb +0 -34
  117. data/spec/fixtures/rails50/config/boot.rb +0 -3
  118. data/spec/fixtures/rails50/config/cable.yml +0 -9
  119. data/spec/fixtures/rails50/config/environment.rb +0 -5
  120. data/spec/fixtures/rails50/config/environments/development.rb +0 -44
  121. data/spec/fixtures/rails50/config/environments/production.rb +0 -75
  122. data/spec/fixtures/rails50/config/environments/test.rb +0 -42
  123. data/spec/fixtures/rails50/config/initializers/application_controller_renderer.rb +0 -6
  124. data/spec/fixtures/rails50/config/initializers/backtrace_silencers.rb +0 -7
  125. data/spec/fixtures/rails50/config/initializers/cookies_serializer.rb +0 -5
  126. data/spec/fixtures/rails50/config/initializers/filter_parameter_logging.rb +0 -4
  127. data/spec/fixtures/rails50/config/initializers/inflections.rb +0 -16
  128. data/spec/fixtures/rails50/config/initializers/mime_types.rb +0 -4
  129. data/spec/fixtures/rails50/config/initializers/new_framework_defaults.rb +0 -21
  130. data/spec/fixtures/rails50/config/initializers/session_store.rb +0 -3
  131. data/spec/fixtures/rails50/config/initializers/wrap_parameters.rb +0 -9
  132. data/spec/fixtures/rails50/config/locales/en.yml +0 -23
  133. data/spec/fixtures/rails50/config/puma.rb +0 -47
  134. data/spec/fixtures/rails50/config/routes.rb +0 -9
  135. data/spec/fixtures/rails50/config/secrets.yml +0 -23
  136. data/spec/fixtures/rails50/public/404.html +0 -67
  137. data/spec/fixtures/rails50/public/422.html +0 -67
  138. data/spec/fixtures/rails50/public/500.html +0 -66
  139. data/spec/fixtures/rails50/public/apple-touch-icon-precomposed.png +0 -0
  140. data/spec/fixtures/rails50/public/apple-touch-icon.png +0 -0
  141. data/spec/fixtures/rails50/public/favicon.ico +0 -0
  142. data/spec/fixtures/rails50/public/robots.txt +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cdc0f0a6e5b8ea5868e4b85c00638ed67d73fac4
4
- data.tar.gz: 79969e8d9e8e2a06649e6ad7c5cb857cbce35f86
2
+ SHA256:
3
+ metadata.gz: b7c3c0cd9e1fab4d284e3adc88c1d27ee6c61f97832eb29510bbc4f44c59b302
4
+ data.tar.gz: 7215fed59ad0cb9e9e66ae6b8d60ed5c8da4929a4d7e91372bdae98b266a0783
5
5
  SHA512:
6
- metadata.gz: 3ade6b8ec6ee1c29d66eb45cd2b04ff8d8334a266312fa3ac24268b575b90113ba56d24432aee50f25d41d6a22a1a9903014d518437cdd1c2ccaf9fcf03381aa
7
- data.tar.gz: 3556ccbed13ad63dad04534a6b87a4b25b5ac75eb84ecba88e059df63aa2e2cf3749a2fb4e3e063fa57494311d2cc01fcb642498e2901099f3352c4151064085
6
+ metadata.gz: b447cbd98d83ed537851a626688de411fffa053a97fb7d24bc0988dd5f21c6a9cee63f4ac88948cba9bafe820a94b1478da3fcb9617041bfb6c70ce652a402b1
7
+ data.tar.gz: 517841207ffc10a6f3badab0893cf13f7ad45c1e4c21dcc0b92752b7ee0de0f270f9bfe0be75739f0a034edc74b5bcafe9f8a73ba53220ee1527f70dcbbd7f49
@@ -0,0 +1,157 @@
1
+ basic_build: &basic_build
2
+ working_directory: ~/loga
3
+ docker:
4
+ - image: circleci/ruby:2.5.1
5
+
6
+ test_build: &test_build
7
+ working_directory: ~/loga
8
+ steps:
9
+ - checkout
10
+ - &restore_gems
11
+ restore_cache:
12
+ keys:
13
+ - v2-gems-{{ checksum "Gemfile" }}-{{ checksum "Appraisals"}}-{{ .Environment.CIRCLE_JOB }}
14
+ - v2-gems-{{ checksum "Gemfile" }}
15
+ - &bundle_install
16
+ run: bundle install --jobs 4 --path=vendor/bundle --retry 3
17
+ - run: bundle exec appraisal install
18
+ - &cache_gems
19
+ save_cache:
20
+ key: v2-gems-{{ checksum "Gemfile" }}-{{ checksum "Appraisals"}}-{{ .Environment.CIRCLE_JOB }}
21
+ paths:
22
+ - gemfiles/vendor/bundle
23
+ - vendor/bundle
24
+ - attach_workspace:
25
+ at: ./tmp
26
+ - run: RACK_ENV=development bundle exec appraisal rspec
27
+ - run: RACK_ENV=production bundle exec appraisal rspec
28
+ - run: ./tmp/cc-test-reporter format-coverage -t simplecov -o $(ruby -e 'puts "tmp/codeclimate.#{RUBY_VERSION}.json"') coverage/.resultset.json
29
+ - persist_to_workspace:
30
+ root: tmp
31
+ paths:
32
+ - codeclimate.*.json
33
+ - store_artifacts:
34
+ path: coverage
35
+
36
+ version: 2
37
+ jobs:
38
+ build:
39
+ <<: *basic_build
40
+ steps:
41
+ - run:
42
+ name: Download cc-test-reporter
43
+ command: |
44
+ mkdir -p tmp/
45
+ curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
46
+ chmod +x ./tmp/cc-test-reporter
47
+ - persist_to_workspace:
48
+ root: ./tmp
49
+ paths:
50
+ - cc-test-reporter
51
+ upload-coverage:
52
+ <<: *basic_build
53
+ steps:
54
+ - attach_workspace:
55
+ at: ./tmp
56
+ - run:
57
+ name: Upload coverage results to Code Climate
58
+ command: |
59
+ ./tmp/cc-test-reporter sum-coverage tmp/codeclimate.*.json -o tmp/codeclimate.total.json
60
+ ./tmp/cc-test-reporter upload-coverage -i tmp/codeclimate.total.json -r $CODECLIMATE_REPO_TOKEN
61
+ ruby-2.2:
62
+ docker:
63
+ - image: circleci/ruby:2.2.10
64
+ <<: *test_build
65
+ ruby-2.3:
66
+ docker:
67
+ - image: circleci/ruby:2.3.7
68
+ <<: *test_build
69
+ ruby-2.4:
70
+ docker:
71
+ - image: circleci/ruby:2.4.4
72
+ <<: *test_build
73
+ ruby-2.5:
74
+ docker:
75
+ - image: circleci/ruby:2.5.1
76
+ <<: *test_build
77
+ rubocop:
78
+ <<: *basic_build
79
+ steps:
80
+ - checkout
81
+ - *restore_gems
82
+ - *bundle_install
83
+ - *cache_gems
84
+ - run: bundle exec rubocop
85
+ push-to-rubygems:
86
+ <<: *basic_build
87
+ steps:
88
+ - checkout
89
+ - *restore_gems
90
+ - *bundle_install
91
+ - *cache_gems
92
+ - run:
93
+ name: Build the gem
94
+ command: gem build $CIRCLE_PROJECT_REPONAME.gemspec
95
+ - deploy:
96
+ name: Publish to rubygems
97
+ command: |
98
+ echo ":rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
99
+ chmod 0600 ~/.gem/credentials
100
+ gem push $CIRCLE_PROJECT_REPONAME-$(echo $CIRCLE_TAG | sed -e 's/v//').gem
101
+ workflows:
102
+ version: 2
103
+ test-then-push-gem:
104
+ jobs:
105
+ - build:
106
+ filters:
107
+ tags:
108
+ only: /.*/
109
+ - rubocop:
110
+ filters:
111
+ tags:
112
+ only: /.*/
113
+ - ruby-2.2:
114
+ filters:
115
+ tags:
116
+ only: /.*/
117
+ requires:
118
+ - build
119
+ - ruby-2.3:
120
+ filters:
121
+ tags:
122
+ only: /.*/
123
+ requires:
124
+ - build
125
+ - ruby-2.4:
126
+ filters:
127
+ tags:
128
+ only: /.*/
129
+ requires:
130
+ - build
131
+ - ruby-2.5:
132
+ filters:
133
+ tags:
134
+ only: /.*/
135
+ requires:
136
+ - build
137
+ - upload-coverage:
138
+ filters:
139
+ tags:
140
+ only: /.*/
141
+ requires:
142
+ - ruby-2.2
143
+ - ruby-2.3
144
+ - ruby-2.4
145
+ - ruby-2.5
146
+ - push-to-rubygems:
147
+ filters:
148
+ tags:
149
+ only: /^v\d.+/
150
+ branches:
151
+ ignore: /.*/
152
+ requires:
153
+ - rubocop
154
+ - ruby-2.2
155
+ - ruby-2.3
156
+ - ruby-2.4
157
+ - ruby-2.5
@@ -0,0 +1,4 @@
1
+ engines:
2
+ rubocop:
3
+ enabled: true
4
+ channel: rubocop-0-50
data/.gitignore CHANGED
@@ -23,3 +23,5 @@ tmp
23
23
  mkmf.log
24
24
  spec/fixtures/**/*.log
25
25
  gemfiles/*.lock
26
+ vendor/bundle
27
+ .byebug_history
@@ -1,14 +1,25 @@
1
1
  AllCops:
2
2
  Exclude:
3
- - 'spec/fixtures/**/*'
4
3
  - '*.gemspec'
4
+ - 'spec/fixtures/**/*'
5
+ - 'vendor/bundle/**/*'
5
6
 
6
7
  Documentation:
7
- Enabled: false
8
+ Enabled: false
9
+
10
+ Layout/ExtraSpacing:
11
+ Enabled: false
12
+
13
+ Layout/SpaceAroundOperators:
14
+ Enabled: false
8
15
 
9
16
  Metrics/AbcSize:
10
17
  Enabled: false
11
18
 
19
+ Metrics/BlockLength:
20
+ Exclude:
21
+ - spec/**/*_spec.rb
22
+
12
23
  Metrics/LineLength:
13
24
  Enabled: true
14
25
  Max: 90
@@ -17,9 +28,6 @@ Metrics/MethodLength:
17
28
  Enabled: true
18
29
  Max: 15
19
30
 
20
- Style/ExtraSpacing:
21
- Enabled: false
22
-
23
31
  Style/BlockDelimiters:
24
32
  Enabled: false
25
33
 
@@ -29,9 +37,6 @@ Style/FormatString:
29
37
  Style/PerlBackrefs:
30
38
  Enabled: false
31
39
 
32
- Style/SpaceAroundOperators:
33
- Enabled: false
34
-
35
40
  Style/TrailingCommaInLiteral:
36
41
  Enabled: true
37
42
  EnforcedStyleForMultiline: comma
data/Appraisals CHANGED
@@ -1,17 +1,27 @@
1
- appraise 'rails32' do
2
- gem 'rails', '~> 3.2.0'
1
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.4.0')
2
+ appraise 'rails32' do
3
+ gem 'rails', '~> 3.2.0'
4
+ end
5
+
6
+ appraise 'rails40' do
7
+ gem 'rails', '~> 4.0.0'
8
+ end
3
9
  end
4
10
 
5
- appraise 'rails40' do
6
- gem 'rails', '~> 4.0.0'
11
+ appraise 'rails42' do
12
+ gem 'rails', '~> 4.2.0'
7
13
  end
8
14
 
9
15
  appraise 'sinatra14' do
10
- gem 'sinatra', '~> 1.4.0'
16
+ gem 'sinatra', '~> 1.4.0'
11
17
  end
12
18
 
13
19
  appraise 'rails50' do
14
- gem 'rails', '~> 5.0.0'
20
+ gem 'rails', '~> 5.0.0'
21
+ end
22
+
23
+ appraise 'rails52' do
24
+ gem 'rails', '~> 5.2.0'
15
25
  end
16
26
 
17
27
  appraise 'unit' do
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
 
7
+ ## [2.2.0] - 2018-05-10
8
+ ### Added
9
+ Subscribe to `ActionMailer` events
10
+ - deliver
11
+ - process
12
+ - receive
13
+
7
14
  ## [2.1.2] - 2016-12-08
8
15
  ### Fixed
9
16
  - `Loga::Rack::Logger` looks into `env['rack.exception']` for exceptions
data/Gemfile CHANGED
@@ -5,5 +5,4 @@ gemspec
5
5
 
6
6
  group :test do
7
7
  gem 'simplecov'
8
- gem 'codeclimate-test-reporter', '~> 1.0.0', require: false
9
8
  end
data/Guardfile CHANGED
@@ -4,7 +4,7 @@ guard :rubocop do
4
4
  end
5
5
 
6
6
  group :sinatra do
7
- %w(production development).each do |env|
7
+ %w[production development].each do |env|
8
8
  guard :rspec,
9
9
  all_on_start: true,
10
10
  cmd: "RACK_ENV=#{env} bundle exec appraisal sinatra14 rspec" do
@@ -14,23 +14,25 @@ group :sinatra do
14
14
  end
15
15
 
16
16
  group :rails do
17
- %w(production development).each do |env|
18
- %w(rails32 rails40 rails50).each do |appraisal|
19
- guard :rspec,
20
- all_on_start: true,
21
- cmd: "RACK_ENV=#{env} bundle exec appraisal #{appraisal} rspec" do
17
+ %w[production development].each do |env|
18
+ %w[rails32 rails40 rails50 rails52].each do |appraisal|
19
+ cmd = "RACK_ENV=#{env} bundle exec appraisal #{appraisal} rspec"
20
+
21
+ guard :rspec, all_on_start: true, cmd: cmd do
22
22
  watch('lib/loga/railtie.rb') do
23
23
  [
24
24
  'spec/integration/rails/request_spec.rb',
25
25
  'spec/integration/rails/railtie_spec.rb',
26
26
  ]
27
27
  end
28
+
28
29
  watch(%r{^spec/fixtures/rails\d{2}/.+\.rb$}) do
29
30
  [
30
31
  'spec/integration/rails/request_spec.rb',
31
32
  'spec/integration/rails/railtie_spec.rb',
32
33
  ]
33
34
  end
35
+
34
36
  watch(%r{^spec/integration/rails/.+_spec\.rb$})
35
37
  end
36
38
  end
data/README.md CHANGED
@@ -95,6 +95,7 @@ This is made possible by silencing these loggers:
95
95
  - `ActionDispatch::DebugExceptions`
96
96
  - `ActionController::LogSubscriber`
97
97
  - `ActionView::LogSubscriber`
98
+ - `ActionMailer::LogSubscriber`
98
99
 
99
100
  #### Request log tags
100
101
 
data/Rakefile CHANGED
@@ -6,4 +6,4 @@ RSpec::Core::RakeTask.new(:spec)
6
6
  require 'rubocop/rake_task'
7
7
  RuboCop::RakeTask.new(:rubocop)
8
8
 
9
- task default: [:rubocop, :spec]
9
+ task default: %i[rubocop spec]
@@ -6,7 +6,6 @@ gem "rails", "~> 3.2.0"
6
6
 
7
7
  group :test do
8
8
  gem "simplecov"
9
- gem "codeclimate-test-reporter", "~> 1.0.0", :require => false
10
9
  end
11
10
 
12
- gemspec :path => "../"
11
+ gemspec path: "../"
@@ -6,7 +6,6 @@ gem "rails", "~> 4.0.0"
6
6
 
7
7
  group :test do
8
8
  gem "simplecov"
9
- gem "codeclimate-test-reporter", "~> 1.0.0", :require => false
10
9
  end
11
10
 
12
- gemspec :path => "../"
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 4.2.0"
6
+
7
+ group :test do
8
+ gem "simplecov"
9
+ end
10
+
11
+ gemspec path: "../"
@@ -6,7 +6,6 @@ gem "rails", "~> 5.0.0"
6
6
 
7
7
  group :test do
8
8
  gem "simplecov"
9
- gem "codeclimate-test-reporter", "~> 1.0.0", :require => false
10
9
  end
11
10
 
12
- gemspec :path => "../"
11
+ gemspec path: "../"
@@ -0,0 +1,11 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rails", "~> 5.2.0"
6
+
7
+ group :test do
8
+ gem "simplecov"
9
+ end
10
+
11
+ gemspec path: "../"
@@ -6,7 +6,6 @@ gem "sinatra", "~> 1.4.0"
6
6
 
7
7
  group :test do
8
8
  gem "simplecov"
9
- gem "codeclimate-test-reporter", "~> 1.0.0", :require => false
10
9
  end
11
10
 
12
- gemspec :path => "../"
11
+ gemspec path: "../"
@@ -4,7 +4,6 @@ source "https://rubygems.org"
4
4
 
5
5
  group :test do
6
6
  gem "simplecov"
7
- gem "codeclimate-test-reporter", "~> 1.0.0", :require => false
8
7
  end
9
8
 
10
- gemspec :path => "../"
9
+ gemspec path: "../"
@@ -13,17 +13,19 @@ module Loga
13
13
  ConfigurationError = Class.new(StandardError)
14
14
 
15
15
  def self.configuration
16
- if @configuration.nil?
16
+ unless @configuration
17
17
  raise ConfigurationError,
18
18
  'Loga has not been configured. Configure with Loga.configure(options)'
19
19
  end
20
+
20
21
  @configuration
21
22
  end
22
23
 
23
24
  def self.configure(options, framework_options = {})
24
- unless @configuration.nil?
25
+ if @configuration
25
26
  raise ConfigurationError, 'Loga has already been configured'
26
27
  end
28
+
27
29
  @configuration ||= Configuration.new(options, framework_options)
28
30
  end
29
31
 
@@ -8,15 +8,15 @@ require 'socket'
8
8
 
9
9
  module Loga
10
10
  class Configuration
11
- FRAMEWORK_EXCEPTIONS = %w(
11
+ FRAMEWORK_EXCEPTIONS = %w[
12
12
  ActionController::RoutingError
13
13
  ActiveRecord::RecordNotFound
14
14
  Sinatra::NotFound
15
- ).freeze
15
+ ].freeze
16
16
 
17
- attr_accessor :device, :filter_exceptions, :filter_parameters, :format,
18
- :host, :level, :service_name, :service_version, :sync, :tags
19
- attr_reader :logger
17
+ attr_accessor :device, :filter_exceptions, :filter_parameters,
18
+ :host, :level, :service_version, :sync, :tags
19
+ attr_reader :logger, :format, :service_name
20
20
 
21
21
  def initialize(user_options = {}, framework_options = {})
22
22
  options = default_options.merge(framework_options)