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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7d70de1320441d2248285276ba8f4c070a5c450a5855cad82e684b312675a5c
4
- data.tar.gz: 3a2bddb8c0d3eaddc3424df7ceca01fe0f8de4f3594a03ec17a35f05b5860e9a
3
+ metadata.gz: cf8635e3a83a61c6935a28fb8ea0aa72b47aec7810d1ec125cc507ccef939179
4
+ data.tar.gz: 97e10f2f2dcc69ae7cf73cf3e2a95c352bb8f477129cf9babee1549b8eb9106a
5
5
  SHA512:
6
- metadata.gz: 742f7fc2b72b941b78bfe08473c333e30ecf4364932f1badbf91f110305a26aac2c936ef959898c5c5e68d6a5b6ef07fbfb0772ec94f17ad2318bb10eb6e40f5
7
- data.tar.gz: ae7614f4cc923e9a8d67a6b8fdb875699fcb40f6862f899349fcd42dfced3f43273cb374ed46029fc835840de681ce9b0782988ab7ff2fab1031b3eb300630a2
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
 
@@ -3,9 +3,16 @@ require 'hedgelog/scrub_replacement'
3
3
  class Hedgelog
4
4
  class Scrubber
5
5
  def initialize(replacements = nil)
6
- @replacements = replacements || [
7
- ScrubReplacement.new('password', '**********')
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Hedgelog
4
- VERSION = '0.1.12'
4
+ VERSION = '0.2.0'
5
5
  end
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.1.12
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: 2019-04-23 00:00:00.000000000 Z
11
+ date: 2020-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yajl-ruby