Sha256: 5bcf742833d7297eda622ebc6c12191ceb56bfc9b5fceea3a3d64350a1be98c6

Contents?: true

Size: 569 Bytes

Versions: 91

Compression:

Stored size: 569 Bytes

Contents

# We use this subclass of Logger in the Scout Agent so we can retrieve all the logged messages at the end of the run.
# This works well only because the Agent is not a long-running process.

require 'logger'

class ScoutLogger < Logger
  attr_reader :messages

  def initialize(*args)
    @messages=[]
    super
  end

  # this is the method that ultimately gets called whenever you invoke info, debug, etc.
  def add(severity, message=nil, progname = nil, &block)
    @messages << "[#{Time.now.strftime('%Y-%m-%d %H:%M:%S ')} ##{$$}] : #{progname}"
    super
  end
end

Version data entries

91 entries across 91 versions & 2 rubygems

Version Path
scout-5.9.13 lib/scout/scout_logger.rb
scout-5.9.12 lib/scout/scout_logger.rb
scout-5.9.11 lib/scout/scout_logger.rb
scout-5.9.10.pre lib/scout/scout_logger.rb
scout-5.9.8 lib/scout/scout_logger.rb
scout-5.9.7.2.pre lib/scout/scout_logger.rb
scout-5.9.8.pre lib/scout/scout_logger.rb
scout-5.9.7.1 lib/scout/scout_logger.rb
scout-5.9.7.pre lib/scout/scout_logger.rb
scout-5.9.5 lib/scout/scout_logger.rb
scout-5.9.4 lib/scout/scout_logger.rb
scout-5.9.4.pre lib/scout/scout_logger.rb
scout-5.9.3 lib/scout/scout_logger.rb
scout-5.9.2 lib/scout/scout_logger.rb
scout-5.9.1 lib/scout/scout_logger.rb
scout-5.9.1.pre lib/scout/scout_logger.rb
scout-5.9.0 lib/scout/scout_logger.rb
scout-5.9.0.pre lib/scout/scout_logger.rb
scout-5.8.9 lib/scout/scout_logger.rb
scout-5.8.8 lib/scout/scout_logger.rb