Sha256: 2901585ad00a4564c0ba33de532d579fa5b7f1b4292c379b66838ef2a0bde1a0

Contents?: true

Size: 944 Bytes

Versions: 1

Compression:

Stored size: 944 Bytes

Contents

require 'rails/railtie'
require 'action_view/log_subscriber'
require 'action_controller/log_subscriber'
require 'active_record/log_subscriber'
require 'action_mailer/log_subscriber'

module Kenny
  # Tie to Rails application to access Rails.application.config
  class Railtie < Rails::Railtie
    config.kenny = Kenny.configs

    config.after_initialize do |app|
      Kenny.application = app

      # Define anonymous classes that inherit from ActiveSupport::LogSubscriber.
      # Within that anonymous class, define methods that
      # perform the user-defined actions when that instrumentation occurs.
      # If desired, user can define a specific logger for the specified instrumentation.
      Kenny.attach_to_instrumentations

      # Unsubscribe all default Rails LogSubscribers if demanded
      Kenny.unsubscribe_from_rails_defaults

      # Suppress Rails::Rack::Logger's output
      Kenny.suppress_rack_logger
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kenny-0.1.2 lib/kenny/railtie.rb