Class: QAT::Logger::RemoteOutputter::Message

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/qat/logger/outputter/remote/message.rb

Overview

This class is a message holder for the RemoteOutputter

Constant Summary collapse

LINE_PARSER =

Regex used to extract file and line information from log events

/^(.*):(\d+)(:in \`(.*)')?/

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(log_event, level, level_name, formatter) ⇒ Message

Returns a new instance of Message.



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/qat/logger/outputter/remote/message.rb', line 19

def initialize(log_event, level, level_name, formatter)
  @log_event                 = log_event
  @content                   = {}
  @content[:level]           = level
  @content['_level_name']    = level_name
  @content["_logger"]        = log_event.fullname
  @content["_log_timestamp"] = Time.now.iso8601(3)

  @formatter = formatter

  set_full_message
  set_short_message
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



12
13
14
# File 'lib/qat/logger/outputter/remote/message.rb', line 12

def content
  @content
end

#formatterObject (readonly)

Returns the value of attribute formatter.



12
13
14
# File 'lib/qat/logger/outputter/remote/message.rb', line 12

def formatter
  @formatter
end

#log_eventObject (readonly)

Returns the value of attribute log_event.



12
13
14
# File 'lib/qat/logger/outputter/remote/message.rb', line 12

def log_event
  @log_event
end