thoth 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36a0fea0a7c3866ead79fbc02e70ff5ae5002e3b
4
- data.tar.gz: a2f1581036daafdf21c24d981059e40be9bc2702
3
+ metadata.gz: 8849c5ed65bc945491752e39279303fb08180b56
4
+ data.tar.gz: 6c09a31e1a61667f77cd859a827a9b7eca7f1e58
5
5
  SHA512:
6
- metadata.gz: 3ecb32050cca7bd0cc0e57ff4fdc4367e8833424976bb0d700ae0666be860733611d2b98a7417315eabb1fb669928c158966c95b9f3b5e4e3fe3d9c9c236ff72
7
- data.tar.gz: 22bbef5466d1b538531df83eb3e0a7ea6b09e586acba72802f2fef4b5c87ba0dd2f111b04422b1ab00f58731b633583691b9c7d59e4f5ca5d3932505dc3c424e
6
+ metadata.gz: d56ff76b64f5b93b6ae1166700cd9c729a0dc9b1b53a830b60a14b76a5988cc42cab5adcf967d060c6367580d03e4f55c1a4f92aabd24fc481394770e419d78a
7
+ data.tar.gz: b63b7c4be0e8de1c0feaf72b9fd45ba56d5ef0024a0334c60a114c7c74c377efde580650360fb33a077d8d59dffe4303bc6283349cb7e4ca6a90287d9a4e36c5
data/lib/thoth/logger.rb CHANGED
@@ -9,6 +9,11 @@ module Thoth
9
9
  @timestamp_key = options.fetch(:timestamp_key, :time)
10
10
  end
11
11
 
12
+ #lazy load this since this class is initialized before rails' filter_parameters is set
13
+ def param_filter
14
+ @param_filter ||= ::ActionDispatch::Http::ParameterFilter.new(::Rails.application.config.filter_parameters)
15
+ end
16
+
12
17
  def log(event_name, details={}, context={})
13
18
  event_data = marshal_event(event_name, details, context)
14
19
 
@@ -21,12 +26,12 @@ module Thoth
21
26
  private
22
27
 
23
28
  def marshal_event(event_name, details, context)
24
- {
29
+ param_filter.filter({
25
30
  event: event_name,
26
31
  timestamp_key => Time.now.utc.strftime(timestamp_format),
27
32
  context: context.reverse_merge(Thoth.context),
28
33
  details: details
29
- }
34
+ })
30
35
  end
31
36
  end
32
37
  end
data/lib/thoth/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Thoth
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thoth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philippe Huibonhoa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-10 00:00:00.000000000 Z
11
+ date: 2017-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport