Class: ScoutLogger

Inherits:
Logger
  • Object
show all
Defined in:
lib/es-scout/scout_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ ScoutLogger

Returns a new instance of ScoutLogger.



9
10
11
12
# File 'lib/es-scout/scout_logger.rb', line 9

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

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



7
8
9
# File 'lib/es-scout/scout_logger.rb', line 7

def messages
  @messages
end

Instance Method Details

#add(severity, message = nil, progname = nil, &block) ⇒ Object

this is the method that ultimately gets called whenever you invoke info, debug, etc.



15
16
17
18
# File 'lib/es-scout/scout_logger.rb', line 15

def add(severity, message=nil, progname = nil, &block)
  @messages << "[#{Time.now.strftime('%Y-%m-%d %H:%M:%S ')} ##{$$}] : #{progname}"
  super
end