Class: ExceptionDog::LogNotifier
- Inherits:
-
Object
- Object
- ExceptionDog::LogNotifier
- Defined in:
- lib/exception_dog/log_notifier.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(configuration) ⇒ LogNotifier
constructor
A new instance of LogNotifier.
- #notify(title, text, opts) ⇒ Object
Constructor Details
#initialize(configuration) ⇒ LogNotifier
12 13 14 15 |
# File 'lib/exception_dog/log_notifier.rb', line 12 def initialize(configuration) @configuration = configuration @logger = configuration.logger end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
9 10 11 |
# File 'lib/exception_dog/log_notifier.rb', line 9 def configuration @configuration end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/exception_dog/log_notifier.rb', line 10 def logger @logger end |
Class Method Details
.clear_log ⇒ Object
26 27 28 |
# File 'lib/exception_dog/log_notifier.rb', line 26 def self.clear_log @@last_log = nil end |
.last_log ⇒ Object
22 23 24 |
# File 'lib/exception_dog/log_notifier.rb', line 22 def self.last_log @@last_log end |
Instance Method Details
#errors ⇒ Object
30 31 32 |
# File 'lib/exception_dog/log_notifier.rb', line 30 def errors [] end |
#notify(title, text, opts) ⇒ Object
17 18 19 20 |
# File 'lib/exception_dog/log_notifier.rb', line 17 def notify(title, text, opts) logger.info "#{title}, #{text}, #{opts}" @@last_log = [title, text, opts] end |