Sha256: 1bcbb30a56e9c652c9622f6d04822f1c068402d077d06d972e7540247a4c07dc

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

raise 'This appsignal gem only works with rails' unless defined?(Rails)

module Appsignal
  class << self
    attr_accessor :subscriber, :event_payload_sanitizer

    def active?
      config && config[:active] == true
    end

    def logger
      @logger ||= Logger.new("#{Rails.root}/log/appsignal.log").tap do |l|
        l.level = Logger::INFO
      end
    end

    def transactions
      @transactions ||= {}
    end

    def agent
      @agent ||= Appsignal::Agent.new
    end

    def config
      @config ||= Appsignal::Config.new(Rails.root, Rails.env).load
    end

    def event_payload_sanitizer
      @event_payload_sanitizer ||= proc { |event| event.payload }
    end
  end
end

require 'appsignal/cli'
require 'appsignal/config'
require 'appsignal/transmitter'
require 'appsignal/agent'
require 'appsignal/marker'
require 'appsignal/middleware'
require 'appsignal/transaction'
require 'appsignal/exception_notification'
require 'appsignal/auth_check'
require 'appsignal/version'
require 'appsignal/railtie'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appsignal-0.4.5 lib/appsignal.rb
appsignal-0.4.4 lib/appsignal.rb
appsignal-0.4.3 lib/appsignal.rb
appsignal-0.4.0 lib/appsignal.rb