Skip to content

Commit

Permalink
enable more trace options
Browse files Browse the repository at this point in the history
  • Loading branch information
nleach999 committed Sep 22, 2021
1 parent aef8213 commit a5ae985
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions CxRestClient/Utility/WebOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,13 @@ public static T ExecuteGet<T>(Func<String, CxRestClient.IO.CxRestClient> clientF
try
{
using (new OpTimer($"GET {url}"))
return client.GetAsync(url, token).Result;
{
var result = client.GetAsync(url, token).Result;

_log.Trace($"GET operation at {url} status: {(int)result.StatusCode}:{result.ReasonPhrase}");

return result;
}
}
catch (Exception ex)
{
Expand Down Expand Up @@ -184,7 +190,13 @@ public static T ExecutePost<T>(Func<String, CxRestClient.IO.CxRestClient> client
// this means if there is an error, a new instance is needed
// on retry.
using (new OpTimer($"POST {url}"))
return client.PostAsync(url, (contentFactory != null) ? contentFactory() : null, token).Result;
{
var result = client.PostAsync(url, (contentFactory != null) ? contentFactory() : null, token).Result;

_log.Trace($"POST operation at {url} status: {(int)result.StatusCode}:{result.ReasonPhrase}");

return result;
}
}
catch (Exception ex)
{
Expand Down

0 comments on commit a5ae985

Please sign in to comment.