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 +4 -4
- data/.travis.yml +2 -1
- data/CHANGELOG.md +3 -0
- data/README.md +2 -0
- data/lib/sapience/configuration.rb +5 -3
- data/lib/sapience/extensions/rails/rack/logger_info_as_debug.rb +14 -1
- data/lib/sapience/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024b1f87a65b6939586988761c7efb9cddb9a283
|
4
|
+
data.tar.gz: 5e5e3643ce29f0d069a21b74ffd498c1524f02df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b3871d833007b403e53d8ff2fb8e60d55b3f00ac9b6e9f1c1f1bd64a3c26710253e3c95341faf41921990d964103797f13fb453ae0ae30f899f217c53708ae
|
7
|
+
data.tar.gz: 565af71953174f4528a4c30f4177e7c691eb95116ccedc0ea27ffd8b4ff459fe4243d1b7ac01912db279b0a2b94d4b70bde8b989048298eb5db517590b1e5b2b
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
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
|
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
|
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
|
-
|
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
|
data/lib/sapience/version.rb
CHANGED
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.
|
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:
|
12
|
+
date: 2019-02-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: concurrent-ruby
|