Sha256: 8575cb749e99b83533968dffa2a38c94d850a4e2a8a2dd7fc73f9a17fbcc9de8

Contents?: true

Size: 1.44 KB

Versions: 7

Compression:

Stored size: 1.44 KB

Contents

require "logger"
require "instana/version"
require "instana/util"
require "instana/helpers"

module Instana
  class << self
    attr_accessor :agent
    attr_accessor :collector
    attr_accessor :tracer
    attr_accessor :processor
    attr_accessor :config
    attr_accessor :logger
    attr_accessor :pid
    attr_reader :secrets

    ##
    # setup
    #
    # Setup the Instana language agent to an informal "ready
    # to run" state.
    #
    def setup
      @agent  = ::Instana::Agent.new
      @tracer = ::Instana::Tracer.new
      @processor = ::Instana::Processor.new
      @collector = ::Instana::Collector.new
      @secrets = ::Instana::Secrets.new
    end
  end
end

# Setup the logger as early as possible

# Default Logger outputs to STDOUT
::Instana.logger = Logger.new(STDOUT)

# Can instead log to a file that is rotated every 10M
# ::Instana.logger = Logger.new("instana.log", 10, 1073741824)

if ENV.key?('INSTANA_GEM_TEST')
  ::Instana.logger.level = Logger::DEBUG
elsif ENV.key?('INSTANA_GEM_DEV') || ENV.key?('INSTANA_DEBUG')
  ::Instana.logger.level = Logger::DEBUG
elsif ENV.key?('INSTANA_QUIET')
  ::Instana.logger.level = Logger::FATAL
else
  ::Instana.logger.level = Logger::WARN
end

::Instana.logger.formatter = proc do |severity, datetime, progname, msg|
  "#{datetime}: #{severity.rjust(5)} Instana: #{progname} #{msg}\n"
end


::Instana.logger.info "Stan is on the scene.  Starting Instana instrumentation version #{::Instana::VERSION}"

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
instana-1.193.4 lib/instana/base.rb
instana-1.193.3 lib/instana/base.rb
instana-1.193.3.pre1 lib/instana/base.rb
instana-1.193.2 lib/instana/base.rb
instana-1.192.1 lib/instana/base.rb
instana-1.192.0 lib/instana/base.rb
instana-1.13.0 lib/instana/base.rb