Class: ExceptionDog::LogNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_dog/log_notifier.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#configurationObject (readonly)

Returns the value of attribute configuration.



9
10
11
# File 'lib/exception_dog/log_notifier.rb', line 9

def configuration
  @configuration
end

#loggerObject (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_logObject



26
27
28
# File 'lib/exception_dog/log_notifier.rb', line 26

def self.clear_log
  @@last_log = nil
end

.last_logObject



22
23
24
# File 'lib/exception_dog/log_notifier.rb', line 22

def self.last_log
  @@last_log
end

Instance Method Details

#errorsObject



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