Class: Timber::Integrations::ActionDispatch::DebugExceptions
- Inherits:
-
Integrator
- Object
- Integrator
- Timber::Integrations::ActionDispatch::DebugExceptions
- Defined in:
- lib/timber-rails/action_dispatch/debug_exceptions.rb
Overview
Reponsible for disabled logging in the ActionDispatch::DebugExceptions Rack middleware. We cannot simply remove the middleware because it is coupled with displaying an exception debug screen if debug exceptions is enabled.
Defined Under Namespace
Modules: InstanceMethods
Instance Method Summary collapse
-
#initialize ⇒ DebugExceptions
constructor
A new instance of DebugExceptions.
- #integrate! ⇒ Object
Constructor Details
#initialize ⇒ DebugExceptions
Returns a new instance of DebugExceptions.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/timber-rails/action_dispatch/debug_exceptions.rb', line 25 def initialize begin # Rails >= 3.1 require "action_dispatch/middleware/debug_exceptions" rescue LoadError # Rails < 3.1 require "action_dispatch/middleware/show_exceptions" end rescue LoadError => e raise RequirementNotMetError.new(e.) end |
Instance Method Details
#integrate! ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/timber-rails/action_dispatch/debug_exceptions.rb', line 37 def integrate! if defined?(::ActionDispatch::DebugExceptions) && !::ActionDispatch::DebugExceptions.include?(InstanceMethods) ::ActionDispatch::DebugExceptions.send(:include, InstanceMethods) end if defined?(::ActionDispatch::ShowExceptions) && !::ActionDispatch::ShowExceptions.include?(InstanceMethods) ::ActionDispatch::ShowExceptions.send(:include, InstanceMethods) end true end |