Class: Loghandler::Rules::GenericErrorLogRule

Inherits:
AbstractRule
  • Object
show all
Defined in:
lib/loghandler/rules/generic_error_log_rule.rb

Instance Method Summary collapse

Methods inherited from AbstractRule

#match?

Constructor Details

#initialize(log_detail) ⇒ GenericErrorLogRule

Returns a new instance of GenericErrorLogRule.



5
6
7
# File 'lib/loghandler/rules/generic_error_log_rule.rb', line 5

def initialize(log_detail)
  @log_detail=log_detail
end

Instance Method Details

#apply!Object



8
9
10
# File 'lib/loghandler/rules/generic_error_log_rule.rb', line 8

def apply!
  @log_detail[:severity]="error"
end

#logObject



11
12
13
# File 'lib/loghandler/rules/generic_error_log_rule.rb', line 11

def log
 @log_detail.to_json
end

#loggable?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/loghandler/rules/generic_error_log_rule.rb', line 14

def loggable?
  true
end

#persist?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/loghandler/rules/generic_error_log_rule.rb', line 17

def persist?
  false
end

#showable?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/loghandler/rules/generic_error_log_rule.rb', line 20

def showable?
  true
end