Skip to content

Commit

Permalink
Updated version for CodeSite logging supporting IMARSRequest and IMAR…
Browse files Browse the repository at this point in the history
…SResponse
  • Loading branch information
Bjørn Larsen authored and andrea-magni committed Nov 6, 2020
1 parent 0cb4448 commit 2fd3758
Showing 1 changed file with 27 additions and 21 deletions.
48 changes: 27 additions & 21 deletions Source/MARS.Utils.ReqRespLogger.CodeSite.pas
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,19 @@ implementation
Exit;

LRequest := TMARSRequestLogCodeSite.Create(AR.Request);
TMARSReqRespLoggerCodeSite.Instance.Log(
String.Join(LOGFIELD_SEPARATOR,
[
'Incoming',
'Engine: ' + AR.Engine.Name,
'Application: ' + AR.Application.Name
]
), LRequest
);
LRequest.Free;
try
TMARSReqRespLoggerCodeSite.Instance.Log(
String.Join(LOGFIELD_SEPARATOR,
[
'Incoming',
'Engine: ' + AR.Engine.Name,
'Application: ' + AR.Application.Name
]
), LRequest
);
finally
LRequest.Free;
end;
end
);

Expand All @@ -131,17 +134,20 @@ implementation
Exit;

LResponse := TMARSResponseLogCodeSite.Create(AR.Response);
TMARSReqRespLoggerCodeSite.Instance.Log(
string.Join(LOGFIELD_SEPARATOR
, [
'Outgoing'
, 'Time: ' + AR.InvocationTime.ElapsedMilliseconds.ToString + ' ms'
, 'Engine: ' + AR.Engine.Name
, 'Application: ' + AR.Application.Name
]
), LResponse
);
LResponse.Free;
try
TMARSReqRespLoggerCodeSite.Instance.Log(
string.Join(LOGFIELD_SEPARATOR
, [
'Outgoing'
, 'Time: ' + AR.InvocationTime.ElapsedMilliseconds.ToString + ' ms'
, 'Engine: ' + AR.Engine.Name
, 'Application: ' + AR.Application.Name
]
), LResponse
);
finally
LResponse.Free;
end;
end
);
end;
Expand Down

0 comments on commit 2fd3758

Please sign in to comment.