Sha256: d50bc553de149646719e228e58e05738fd1edf35e299ee16170d3dffef6f248b

Contents?: true

Size: 974 Bytes

Versions: 13

Compression:

Stored size: 974 Bytes

Contents

# Copyright (c) 2016 SolarWinds, LLC.
# All rights reserved.

require 'logger'

module AppOpticsAPM
  class << self
    attr_accessor :logger
  end

  class Logger
    # Fatal message
    def fatal(string, exception = nil)
      AppOpticsAPM.logger.fatal(string) if AppOpticsAPM.logger
    end

    # Error message
    def error(msg, exception = nil)
      AppOpticsAPM.logger.error(string) if AppOpticsAPM.logger
    end

    # Warn message
    def warn(msg, exception = nil)
      AppOpticsAPM.logger.warn(string) if AppOpticsAPM.logger
    end

    # Info message
    def info(msg, exception = nil)
      AppOpticsAPM.logger.info(string) if AppOpticsAPM.logger
    end

    # Debug message
    def debug(msg, exception = nil)
      AppOpticsAPM.logger.debug(string) if AppOpticsAPM.logger
    end

  end
end

AppOpticsAPM.logger = Logger.new(STDERR)
# set log level to INFO to be consistent with the c-lib, DEBUG would be default
AppOpticsAPM.logger.level = Logger::INFO

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
appoptics_apm_mnfst-4.5.2 lib/appoptics_apm/logger.rb
appoptics_apm-4.5.2 lib/appoptics_apm/logger.rb
appoptics_apm-4.5.1 lib/appoptics_apm/logger.rb
appoptics_apm-4.5.0 lib/appoptics_apm/logger.rb
appoptics_apm-4.4.1 lib/appoptics_apm/logger.rb
appoptics_apm-4.4.0 lib/appoptics_apm/logger.rb
appoptics_apm-4.3.1 lib/appoptics_apm/logger.rb
appoptics_apm-4.3.0 lib/appoptics_apm/logger.rb
appoptics_apm-4.2.7 lib/appoptics_apm/logger.rb
appoptics_apm-4.2.6 lib/appoptics_apm/logger.rb
appoptics_apm-4.2.5 lib/appoptics_apm/logger.rb
appoptics_apm-4.2.4 lib/appoptics_apm/logger.rb
appoptics_apm-4.2.3 lib/appoptics_apm/logger.rb