Class: Safely::Strategy::Log
- Inherits:
-
Object
- Object
- Safely::Strategy::Log
- Defined in:
- lib/safely/strategy/log.rb
Class Attribute Summary collapse
-
.flush ⇒ Object
Flush logger.
-
.logger ⇒ Object
Logger to use.
Class Method Summary collapse
Class Attribute Details
.flush ⇒ Object
Flush logger
11 12 13 |
# File 'lib/safely/strategy/log.rb', line 11 def flush @flush end |
.logger ⇒ Object
Logger to use
8 9 10 |
# File 'lib/safely/strategy/log.rb', line 8 def logger @logger end |
Class Method Details
.load! ⇒ Object
13 14 15 |
# File 'lib/safely/strategy/log.rb', line 13 def load! @flush ||= false end |
.report!(exception) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/safely/strategy/log.rb', line 17 def report!( exception ) return if self.logger.nil? self.logger.error("[SAFELY] Type: #{exception.class.name}") self.logger.error("[SAFELY] Message: #{exception.}") self.logger.error("[SAFELY] Backtrace: #{exception.backtrace.join("\n ")}") self.logger.flush if self.logger.respond_to?(:flush) && self.flush end |