Class: Barbeque::ExceptionHandler::RailsLogger
- Inherits:
-
Object
- Object
- Barbeque::ExceptionHandler::RailsLogger
- Defined in:
- lib/barbeque/exception_handler.rb
Instance Method Summary collapse
- #clear_context ⇒ Object
- #handle_exception(e) ⇒ Object
-
#initialize ⇒ RailsLogger
constructor
A new instance of RailsLogger.
- #set_message_context(message_id, message_type) ⇒ Object
Constructor Details
#initialize ⇒ RailsLogger
Returns a new instance of RailsLogger.
16 17 18 |
# File 'lib/barbeque/exception_handler.rb', line 16 def initialize clear_context end |
Instance Method Details
#clear_context ⇒ Object
20 21 22 23 |
# File 'lib/barbeque/exception_handler.rb', line 20 def clear_context @message_id = nil @message_type = nil end |
#handle_exception(e) ⇒ Object
33 34 35 |
# File 'lib/barbeque/exception_handler.rb', line 33 def handle_exception(e) Rails.logger.error("#{e.inspect}\nmessage_id: #{@message_id}, message_type: #{@message_type}\n#{e.backtrace.join("\n")}") end |
#set_message_context(message_id, message_type) ⇒ Object
27 28 29 30 |
# File 'lib/barbeque/exception_handler.rb', line 27 def (, ) @message_id = @message_type = end |