sapience 2.7.0 → 2.8

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
  SHA1:
3
- metadata.gz: b73285e98f5fc0d1a47770f8a9aaa46ca9cdb392
4
- data.tar.gz: 06904793b69382fff48e1cfdd8deaaa8b277f682
3
+ metadata.gz: 024b1f87a65b6939586988761c7efb9cddb9a283
4
+ data.tar.gz: 5e5e3643ce29f0d069a21b74ffd498c1524f02df
5
5
  SHA512:
6
- metadata.gz: e97abc320690cbea9cbb02a8658ddaa4391f350c665b11122ce8a4b432d84c3def3b808b1ac2460447d96b6fd980e243f9342a749227145802918b7e54c9e30b
7
- data.tar.gz: 8704dd5f928835b063eeb2fbd9fa24780cff06a6736db54335085acc4c056502d7ff8fb06810044b02f91140593c61337caa79a8578e18b9c89019fe02a9850c
6
+ metadata.gz: d9b3871d833007b403e53d8ff2fb8e60d55b3f00ac9b6e9f1c1f1bd64a3c26710253e3c95341faf41921990d964103797f13fb453ae0ae30f899f217c53708ae
7
+ data.tar.gz: 565af71953174f4528a4c30f4177e7c691eb95116ccedc0ea27ffd8b4ff459fe4243d1b7ac01912db279b0a2b94d4b70bde8b989048298eb5db517590b1e5b2b
data/.travis.yml CHANGED
@@ -12,7 +12,8 @@ services:
12
12
  - docker
13
13
 
14
14
  before_install:
15
- - gem install bundler
15
+ - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
16
+ - gem install bundler -v '< 2'
16
17
 
17
18
  install: bundle install --jobs 8 --retry 5
18
19
 
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## v2.8.0
2
+ - Silence rails rack logger for rails 3 by setting `silent_rack: true` in sapience.yml
3
+
1
4
  ## v2.7.0
2
5
  - Add ability to stop generating metrics for ActiveRecord::Notification with config option `silent_active_record`
3
6
 
data/README.md CHANGED
@@ -166,6 +166,7 @@ staging:
166
166
  production:
167
167
  log_level: info
168
168
  silent_rails: true # make rails logging less noisy
169
+ silent_rack: true # stop rack from logging "Request Started..." messages
169
170
  error_handler:
170
171
  sentry:
171
172
  dsn: <%= ENV['SENTRY_DSN'] %>
@@ -186,6 +187,7 @@ Sapience.configure(force: true) do |config|
186
187
  config.default_level = :info
187
188
  config.backtrace_level = :error
188
189
  config.silent_rails = true # make rails logging less noisy
190
+ config.silent_rack = true # silence rack logging
189
191
  config.filter_parameters = %w(password password_confirmation)
190
192
  config.appenders = [
191
193
  { stream: { io: STDOUT, formatter: :color } },
@@ -8,7 +8,7 @@ module Sapience
8
8
  attr_reader :default_level, :backtrace_level, :backtrace_level_index
9
9
  attr_writer :host
10
10
  attr_accessor :app_name, :ap_options, :appenders, :log_executor, :filter_parameters,
11
- :metrics, :error_handler, :silent_active_record, :silent_rails
11
+ :metrics, :error_handler, :silent_active_record, :silent_rails, :silent_rack
12
12
 
13
13
  SUPPORTED_EXECUTORS = %i(single_thread_executor immediate_executor).freeze
14
14
  DEFAULT = {
@@ -22,6 +22,7 @@ module Sapience
22
22
  filter_parameters: %w(password password_confirmation),
23
23
  silent_active_record: false,
24
24
  silent_rails: false,
25
+ silent_rack: false,
25
26
  }.freeze
26
27
 
27
28
  # Initial default Level for all new instances of Sapience::Logger
@@ -30,7 +31,7 @@ module Sapience
30
31
  @options = DEFAULT.merge(options.dup.deep_symbolize_keyz!)
31
32
  @options[:log_executor] &&= @options[:log_executor].to_sym
32
33
  validate_log_executor!(@options[:log_executor])
33
- self.default_level = @options[:log_level].to_sym
34
+ self.default_level = @options[:log_level].to_sym
34
35
  self.backtrace_level = @options[:log_level].to_sym
35
36
  self.host = @options[:host]
36
37
  self.app_name = @options[:app_name]
@@ -41,7 +42,8 @@ module Sapience
41
42
  self.metrics = @options[:metrics]
42
43
  self.error_handler = @options[:error_handler]
43
44
  self.silent_active_record = @options[:silent_active_record]
44
- self.silent_rails = @options[:silent_rails]
45
+ self.silent_rails = @options[:silent_rails]
46
+ self.silent_rack = @options[:silent_rack]
45
47
  end
46
48
 
47
49
  # Sets the global default log level
@@ -1,7 +1,20 @@
1
1
  # frozen_string_literal: true
2
- # Drop rack Started message to debug level message
2
+ require "rails/rack/logger"
3
+
4
+ # For rails > 3, drop rack Started message to debug level message
5
+ # For rails == 3, patch the logger to remove the log lines
6
+ # that say: 'Started GET / for 192.168.2.1...'
3
7
  class Rails::Rack::Logger # rubocop:disable ClassAndModuleChildren
4
8
 
9
+ if Rails::VERSION::MAJOR == 3 && ::Sapience.config.silent_rack
10
+ def call_app(*args)
11
+ env = args.last
12
+ @app.call(env)
13
+ ensure
14
+ ActiveSupport::LogSubscriber.flush_all!
15
+ end
16
+ end
17
+
5
18
  private
6
19
 
7
20
  module Extensions
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Sapience
3
- VERSION = "2.7.0"
3
+ VERSION = "2.8"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sapience
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: '2.8'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-14 00:00:00.000000000 Z
12
+ date: 2019-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby