sapience 0.2.12 → 0.2.13

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: 0803dd38f93ede1b7a868dfdc41f63d64ae4a245
4
- data.tar.gz: ee1c5c5fee410d23477c87f62f3430e646e299a2
3
+ metadata.gz: 485b7ea86a14e6bcfaedc9a9d2d9d944654ea2c7
4
+ data.tar.gz: a650a5681fb862e0b85172df46cef8e7ceffa077
5
5
  SHA512:
6
- metadata.gz: bb2695701ee496b716a8d6bd5647b663af5b2cbfc5c7e24c01364a210060c08a5feab50d6809d91c6fe79132c6c6592b6b1a9fca0671216ee4b17e35bd6dbcc0
7
- data.tar.gz: 56f895348d5e890a747a1a68543fdd02b32e47cb3a03934a8b133bd55f8a03b3567f1440e927ffde33b86eb5f518c291e7989523e060e3e19f95355a24244dd1
6
+ metadata.gz: 9d53690aaf69e9bd76400df5cdfd368799d4b6a50089653add9f22501f92c9f8ddda46aecb2bc65ff9f108e990ff40f6df2b2167bcc5eadade63b1f89c2fc940
7
+ data.tar.gz: 92711be9adea5c7290cd0aed92f5df6a7c233b8f611c8c1e9fee7a4dc0bb52cd343741595ef1565f873e142465d5b6b87587f2ed9c0ddc4e4799f4f3ddfc03c7
data/.travis.yml CHANGED
@@ -18,4 +18,6 @@ after_success:
18
18
 
19
19
  notifications:
20
20
  slack:
21
+ on_success: change
22
+ on_failure: change
21
23
  secure: apFwkfBQ+3NDJgcLNCHQori9qtr6ePaN3Xx7Sy7NVWwYm9BHNxoX/FN8/hxR63JjXrf1C0hK0FLQ0TiA0BN9PgEEIecg78BvWUwMClDDiwhyYN3H0Bbg35PUFtgDIrOGpu/TYlxNmdHEDYEAxaWsl9wSds8pAJsN6m7VTjGfBwJUDcOiM4L1eRpbp7smPqOjmuQFuOJnO8YkPb+6nUfz53cJrMRUdha89Vgmvnw6cP4/Ms1TsL3vKmMSVbGGh/6WNKPjU6IbuUjwlsh6a9xWxQOk6Wnis/Z+kA+T0XbLMuTLLmzRDuql1tjJeMPi+wukmK1a7GjpPkpkzAgwLQ/CkjTBfIRbMyaBYSuAciuOY8PDtCcT4WLwEvdZbkFmhAdSr1RYxIBpONVfZ/5DT3bpk71+O74OIBqxG6NmkiZ0B6u9/KxbnIINLVAcVaqsN8sdSqWlWKzPm45BfGPXGjmGGgIVFU31rs+W5Zs7IYMNUjZxabYKIv9TsBONbogfbcoGZA+rWWUnQdjypNWJS9wyQDvJ4btxqy8YhDfaV6gF30Un5JcAggMutzKJiYi+qAeh0uN3/9XoXV2N6XBnh58h8ny1NY+0vklWhtFGR1wfFAqkDskvCIZabSeJ5bFM6FtNbNKq9tYciS+eAO1vEYQVDFt9eY2uZF2mFDKRnEegHMU=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.2.13
2
+
3
+ - Set Rails.logger even some gems disables logging on initialisation.
4
+
1
5
  ## v0.2.12
2
6
 
3
7
  - Adds support for Rails apps with disabled ActiveRecord
data/lib/sapience/base.rb CHANGED
@@ -175,7 +175,7 @@ module Sapience
175
175
  # logger.debug('Hello World', result: 'blah')
176
176
  # end
177
177
  def with_payload(payload)
178
- current_payload = self.payload
178
+ current_payload = self.payload
179
179
  Thread.current[:sapience_payload] = current_payload ? current_payload.merge(payload) : payload
180
180
  yield
181
181
  ensure
@@ -222,7 +222,10 @@ module Sapience
222
222
  fail ArgumentError, ":filter must be a Regexp or Proc" unless filter.nil? || filter.is_a?(Regexp) || filter.is_a?(Proc)
223
223
 
224
224
  @filter = filter.is_a?(Regexp) ? filter.freeze : filter
225
- @name = klass.is_a?(String) ? klass : klass.name
225
+ @name = klass if klass.is_a?(String)
226
+ @name ||= klass.name if klass.respond_to?(:name)
227
+ @name ||= klass.class.name
228
+
226
229
  if level.nil?
227
230
  # Allow the global default level to determine this loggers log level
228
231
  @level_index = nil
@@ -57,6 +57,9 @@ module Sapience
57
57
 
58
58
  # Before any initializers run, but after the gems have been loaded
59
59
  config.after_initialize do
60
+ # in the rare case a gem disables logging but still requires a logger (teaspoon gem)
61
+ ::Rails.logger ||= Sapience[::Rails]
62
+
60
63
  require "sapience/extensions/action_cable/tagged_logger_proxy" if defined?(ActionCable)
61
64
  require "sapience/extensions/active_model_serializers/logging" if defined?(ActiveModelSerializers)
62
65
  require "sapience/extensions/active_job/logging" if defined?(ActiveJob)
@@ -1,3 +1,3 @@
1
1
  module Sapience
2
- VERSION = "0.2.12"
2
+ VERSION = "0.2.13"
3
3
  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: 0.2.12
4
+ version: 0.2.13
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: 2016-09-20 00:00:00.000000000 Z
12
+ date: 2016-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby