Sha256: 52d485a7b6adc01f74622c9d9eb8674fafd6f7750287217198fd96c58908b921

Contents?: true

Size: 915 Bytes

Versions: 2

Compression:

Stored size: 915 Bytes

Contents

module OhMyLog
  module Log
    class Configuration
      attr_accessor :models, :print_log, :record_history, :log_instance, :log_path
      attr_reader :selectors

      def initialize(*args)
        @selectors = []
        #models not to track
        @models = {"ALL" => []}
        @print_log = true
        @log_instance = Logger.new(File.join(Rails.root, 'log/oh_my_log.log'))
        @log_path = nil
        #do we wanna keep track of all the actions?
        @record_history = false
      end

      def add_selector(selector)
        @selectors << selector
      end

      def reset_selectors
        @selectors = []
      end

      def get_actions(controller)
        @selectors.each do |selector|
          return selector.actions if selector.controller == controller
        end
      end

      def process_path
        @log_instance = Logger.new(@log_path) if (@log_path)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oh_my_log-1.0.2 lib/oh_my_log/configuration.rb
oh_my_log-1.0.1 lib/oh_my_log/configuration.rb