Sha256: 397ac1b8a7cca9861f8b63ce4c96459a57c83da19847db4eb1e5cf357b2b64c8

Contents?: true

Size: 1.1 KB

Versions: 15

Compression:

Stored size: 1.1 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

# Base class for startup logging and testing in multiverse

module NewRelic
  module Agent
    class MemoryLogger
      def initialize
        @messages = []
      end

      def is_startup_logger?
        true
      end

      attr_accessor :messages, :level

      def fatal(*msgs, &blk)
        messages << [:fatal, msgs, blk]
      end

      def error(*msgs, &blk)
        messages << [:error, msgs, blk]
      end

      def warn(*msgs, &blk)
        messages << [:warn, msgs, blk]
      end

      def info(*msgs, &blk)
        messages << [:info, msgs, blk]
      end

      def debug(*msgs, &blk)
        messages << [:debug, msgs, blk]
      end

      def log_exception(level, e, backtrace_level=level)
        messages << [:log_exception, [level, e, backtrace_level]]
      end

      def dump(logger)
        messages.each do |(method, args, blk)|
          logger.send(method, *args, &blk)
        end
        messages.clear
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
newrelic_rpm-3.12.0.288 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.11.2.286 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.11.1.284 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.11.0.283 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.10.0.279 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.9.275 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.8.273 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.7.266 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.6.257 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.5.251 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.4.245 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.3.241 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.2.239 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.1.236 lib/new_relic/agent/memory_logger.rb
newrelic_rpm-3.9.0.229 lib/new_relic/agent/memory_logger.rb