Class: Logging::LogEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/hammer_cli/logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger, level, data, caller_tracing) ⇒ LogEvent

Returns a new instance of LogEvent.



7
8
9
10
11
12
13
14
15
# File 'lib/hammer_cli/logger.rb', line 7

def initialize( logger, level, data, caller_tracing )
  # filter out the passwords
  if data.kind_of? String
    self.class.data_filters.each do |filter|
      data = data.gsub(filter[0], filter[1])
    end
  end
  old_initialize(logger, level, data, caller_tracing)
end

Class Method Details

.add_data_filter(pattern, replacement) ⇒ Object



17
18
19
# File 'lib/hammer_cli/logger.rb', line 17

def self.add_data_filter(pattern, replacement)
  data_filters << [pattern, replacement]
end

Instance Method Details

#old_initializeObject



6
# File 'lib/hammer_cli/logger.rb', line 6

alias_method :old_initialize, :initialize