Class: AuditStream

Inherits:
Object
  • Object
show all
Defined in:
lib/tdl/queue/queue_based_implementation_runner.rb

Instance Method Summary collapse

Constructor Details

#initializeAuditStream

Returns a new instance of AuditStream.



93
94
95
96
# File 'lib/tdl/queue/queue_based_implementation_runner.rb', line 93

def initialize
  @logger = Logging.logger[self]
  start_line
end

Instance Method Details

#end_lineObject



126
127
128
# File 'lib/tdl/queue/queue_based_implementation_runner.rb', line 126

def end_line
  @logger.info @str
end

#log_request(request) ⇒ Object



102
103
104
105
106
107
108
109
110
# File 'lib/tdl/queue/queue_based_implementation_runner.rb', line 102

def log_request(request)
  params_as_string = TDL::PresentationUtil.to_displayable_request(request.params)
  text =  "id = #{request.id}, req = #{request.method}(#{params_as_string})"
  
  if not text.empty? and @str.length > 0
    @str << ', '
  end
  @str << text
end

#log_response(response) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/tdl/queue/queue_based_implementation_runner.rb', line 112

def log_response(response)
  if response.instance_variable_defined?(:@result)
    representation = TDL::PresentationUtil.to_displayable_response(response.result)
    text = "resp = #{representation}"
  else
    text = "error = #{response.message}" + ", (NOT PUBLISHED)"
  end
  
  if not text.empty? and @str.length > 0
    @str << ', '
  end
  @str << text
end

#start_lineObject



98
99
100
# File 'lib/tdl/queue/queue_based_implementation_runner.rb', line 98

def start_line
  @str = ''
end