lib/timber/integrations.rb in timber-2.0.24 vs lib/timber/integrations.rb in timber-2.1.0.rc1

- old
+ new

@@ -1,22 +1,29 @@ -require "timber/integrations/action_controller/log_subscriber" -require "timber/integrations/action_dispatch/debug_exceptions" -require "timber/integrations/action_view/log_subscriber" -require "timber/integrations/active_record/log_subscriber" -require "timber/integrations/active_support/tagged_logging" +require "timber/integrations/action_controller" +require "timber/integrations/action_dispatch" +require "timber/integrations/action_view" +require "timber/integrations/active_record" require "timber/integrations/rack" -require "timber/integrations/rails/rack_logger" +require "timber/integrations/rails" module Timber - # Namespace for all integrations. - # @private + # Namespace for all integrations. Each integration provides it's own settings. + # And all integrations can be disabled with the {.enabled=} class method. module Integrations + # Disable / enable _all_ integrations with one setting. + def self.enabled=(value) + ActionController.enabled = value + ActionView.enabled = value + ActiveRecord.enabled = value + Rack.enabled = value + end + + # Integrates all enabled integrations in one call. def self.integrate! - ActionController::LogSubscriber.integrate! - ActionDispatch::DebugExceptions.integrate! - ActionView::LogSubscriber.integrate! - ActiveRecord::LogSubscriber.integrate! - ActiveSupport::TaggedLogging.integrate! - Rails::RackLogger.integrate! + ActionController.integrate! + ActionDispatch.integrate! + ActionView.integrate! + ActiveRecord.integrate! + Rails.integrate! end end end \ No newline at end of file