Sha256: 247d43a1d1860f591f648acf5cae5423b119e25fa4032eaefa70e5960fdcb06f

Contents?: true

Size: 744 Bytes

Versions: 1

Compression:

Stored size: 744 Bytes

Contents

require 'yaml'
require 'will_paginate'

class Tartarus
  module Notifiers; end

  class << self
    def configuration( file = nil )
      if defined?(Rails)
        @cached_configuration ||= YAML.load_file(file || "#{Rails.root}/config/exceptions.yml" )[Rails.env]
      else
        @cached_configuration ||= YAML.load_file(file)
      end
    end

    def logger_class
      configuration['logger_class'].constantize
    end
    
    def logging_enabled?
      configuration['logging_enabled'] == true
    end

    def log(controller, exception)
      logger_class.log(controller, exception)
    end
  end
end

require 'tartarus/rack'
require 'tartarus/logger'
require 'tartarus/notifiers/mail'
require 'tartarus/railtie' if defined?(Rails)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tartarus-2.3 lib/tartarus.rb