Class: AuditStream
- Inherits:
-
Object
- Object
- AuditStream
- Defined in:
- lib/tdl/queue/queue_based_implementation_runner.rb
Instance Method Summary collapse
- #end_line ⇒ Object
-
#initialize ⇒ AuditStream
constructor
A new instance of AuditStream.
- #log_request(request) ⇒ Object
- #log_response(response) ⇒ Object
- #start_line ⇒ Object
Constructor Details
#initialize ⇒ AuditStream
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_line ⇒ Object
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_line ⇒ Object
98 99 100 |
# File 'lib/tdl/queue/queue_based_implementation_runner.rb', line 98 def start_line @str = '' end |