logstop 0.2.1 → 0.2.2

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
  SHA256:
3
- metadata.gz: d1045e35e2d837c1e66abd3916e08357b9cf98bfe4b37e5d0c4b8427901c6bb4
4
- data.tar.gz: 61aecefd1d8b68f4bb48f1819eb9c0aea22b3440a4ebc9958ec2877c2be00d1a
3
+ metadata.gz: da4a7ae0dfced4f2fd89ef52da3c7560b714161722f9e6642628d2bc5c6dc7bd
4
+ data.tar.gz: 8d96132e4c979d29ffec7572e9947f3f2e48cd40305bbefe9b0559a371a7ed13
5
5
  SHA512:
6
- metadata.gz: 610269d02743729383a41c45832f8849988928d998969569dc5013b9dbffde9428a914ec9411a96c883a7ca31aa2866d6534d1a6ef75b038fbb81e064a2fe12e
7
- data.tar.gz: 60eacadc8d8027cc88b88558d05e216dad0f053f1f83c5c0198f934f888f15c01f34335925b13b5b4a0e1714ef8a82c0bb38c3b6bf3021aaadf50d932524a3b6
6
+ metadata.gz: 1eedaef8e9a44ef497585e0dfc0b7ce82b28f88066df8edb13d38b6f181966784bb582996f49f8b469bad457874083d00bfa84b7be07330aa9882c0405882af8
7
+ data.tar.gz: 4c4125427122c48e8f742e37514a25d0c61f29e36c1bc542e4a56b8f37f59e16b011b9ec609b9c735e205c211c8cf2211ddf59fe958c8d11de667a03f8f839cc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.2.2
2
+
3
+ - Added `guard` method
4
+
1
5
  ## 0.2.1
2
6
 
3
7
  - Fix for log broadcaster in Rails console
data/README.md CHANGED
@@ -34,7 +34,7 @@ gem 'logstop'
34
34
  And add it to your logger:
35
35
 
36
36
  ```ruby
37
- logger.formatter = Logstop::Formatter.new(logger.formatter)
37
+ Logstop.guard(logger)
38
38
  ```
39
39
 
40
40
  ### Rails
@@ -42,17 +42,15 @@ logger.formatter = Logstop::Formatter.new(logger.formatter)
42
42
  Create `config/initializers/logstop.rb` with:
43
43
 
44
44
  ```ruby
45
- Rails.logger.formatter = Logstop::Formatter.new(Rails.logger.formatter)
45
+ Logstop.guard(Rails.logger)
46
46
  ```
47
47
 
48
- **Note:** In the Rails console with the default logger, logs show up unfiltered in STDOUT, but filtered in the log file. This is fixed on master.
49
-
50
48
  ## Options
51
49
 
52
50
  To scrub IP addresses, use:
53
51
 
54
52
  ```ruby
55
- Logstop::Formatter.new(formatter, ip: true)
53
+ Logstop.guard(logger, ip: true)
56
54
  ```
57
55
 
58
56
  To scrub outside of logging, use:
data/lib/logstop.rb CHANGED
@@ -26,4 +26,8 @@ module Logstop
26
26
  .gsub(URL_PASSWORD_REGEX, FILTERED_URL_STR)
27
27
  .gsub(EMAIL_REGEX, FILTERED_STR)
28
28
  end
29
+
30
+ def self.guard(logger, **options)
31
+ logger.formatter = Logstop::Formatter.new(logger.formatter, **options)
32
+ end
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Logstop
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane