require 'erorr/config' require 'erorr/middleware/rack' require 'erorr/notification' require 'erorr/transport/http_async' require 'erorr/version' module Erorr extend self def config @config ||= Config.new end def configure yield config if block_given? end def logger config.logger end def notify(exception, params = {}) return false unless config.validate notification = Notification.new exception, params transport.deliver notification.to_params true rescue => e logger.error "[erorr] Internal error: #{e.inspect}" false end private def transport @_transport ||= Erorr::Transport::HTTPAsync.new end end require 'erorr/plugins/rails' if defined? Rails::Railtie