hedgelog 0.1.12 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hedgelog.rb +2 -2
- data/lib/hedgelog/scrubber.rb +10 -3
- data/lib/hedgelog/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf8635e3a83a61c6935a28fb8ea0aa72b47aec7810d1ec125cc507ccef939179
|
4
|
+
data.tar.gz: 97e10f2f2dcc69ae7cf73cf3e2a95c352bb8f477129cf9babee1549b8eb9106a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30155e59568b520b423762cae723b7eccd604bc3552aaa39e42bf62bf6fdf9171c6527eee27a88a0c46089d696813d166b7c1612bd370b9b19ae9d0d72aa257b
|
7
|
+
data.tar.gz: bd4d609ab864a0879f12b4624a9a4aef371a509d8f9ba24d798cfd9b4de0edb92e73cd69360f796496760d885bd9f2aeee719ccb8e6ab392bf181ba0f38c39ef
|
data/lib/hedgelog.rb
CHANGED
@@ -25,12 +25,12 @@ class Hedgelog
|
|
25
25
|
attr_reader :level
|
26
26
|
attr_writer :app
|
27
27
|
|
28
|
-
def initialize(logdev = STDOUT, shift_age = nil, shift_size = nil)
|
28
|
+
def initialize(logdev = STDOUT, shift_age = nil, shift_size = nil, cleaner=nil)
|
29
29
|
@level = LEVELS[:debug]
|
30
30
|
@channel = nil
|
31
31
|
@logdev = nil
|
32
32
|
@app = nil
|
33
|
-
@scrubber = Hedgelog::Scrubber.new
|
33
|
+
@scrubber = Hedgelog::Scrubber.new(cleaner)
|
34
34
|
@normalizer = Hedgelog::Normalizer.new
|
35
35
|
@channel_context = Hedgelog::Context.new(@scrubber, @normalizer)
|
36
36
|
|
data/lib/hedgelog/scrubber.rb
CHANGED
@@ -3,9 +3,16 @@ require 'hedgelog/scrub_replacement'
|
|
3
3
|
class Hedgelog
|
4
4
|
class Scrubber
|
5
5
|
def initialize(replacements = nil)
|
6
|
-
@replacements =
|
7
|
-
|
8
|
-
|
6
|
+
@replacements = [ScrubReplacement.new('password', '**********')]
|
7
|
+
unless replacements.nil?
|
8
|
+
replacements.each do |x|
|
9
|
+
if x.instance_of?(ScrubReplacement)
|
10
|
+
@replacements << x
|
11
|
+
else
|
12
|
+
@replacements << ScrubReplacement.new(x,'**********')
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
9
16
|
end
|
10
17
|
|
11
18
|
def scrub(data)
|
data/lib/hedgelog/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hedgelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Utter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yajl-ruby
|