aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs45
1 files changed, 6 insertions, 39 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
index 2bf2b7364..2cc95e4a6 100644
--- a/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
+++ b/Software/Visual_Studio/Tango.Integration/Storage/StorageManager.cs
@@ -88,37 +88,6 @@ namespace Tango.Integration.Storage
#endregion
- #region Protected Methods
-
- /// <summary>
- /// Logs the request sent.
- /// </summary>
- /// <param name="message">The message.</param>
- protected void LogRequestSent(IMessage message)
- {
- LogManager.Log($"{_transporter.ComponentName}: Sending request '{message.GetType().Name}'...\n{message.ToJsonString()}", LogCategory.Debug);
- }
-
- /// <summary>
- /// Logs the request failed.
- /// </summary>
- /// <param name="message">The message.</param>
- protected void LogRequestFailed(IMessage message, Exception ex)
- {
- LogManager.Log($"{_transporter.ComponentName}: Request failed '{message.GetType().Name}'...\n{message.ToJsonString()}\n{ex.ToString()}", LogCategory.Error);
- }
-
- /// <summary>
- /// Logs the response received.
- /// </summary>
- /// <param name="message">The message.</param>
- protected void LogResponseReceived(IMessage message)
- {
- LogManager.Log($"{_transporter.ComponentName}: Response received '{message.GetType().Name}'...\n{message.ToJsonString()}", LogCategory.Debug);
- }
-
- #endregion
-
#region Public Methods
/// <summary>
@@ -134,11 +103,10 @@ namespace Tango.Integration.Storage
try
{
- response = await _transporter.SendRequest<GetStorageInfoRequest, GetStorageInfoResponse>(request);
+ response = await _transporter.SendRequest<GetStorageInfoRequest, GetStorageInfoResponse>(request, new TransportRequestConfig() { ShouldLog = true });
}
catch (Exception ex)
{
- LogRequestFailed(request, ex);
throw ex;
}
@@ -189,11 +157,10 @@ namespace Tango.Integration.Storage
try
{
- response = await _transporter.SendRequest<GetFilesRequest, GetFilesResponse>(request);
+ response = await _transporter.SendRequest<GetFilesRequest, GetFilesResponse>(request, new TransportRequestConfig() { ShouldLog = true });
}
catch (Exception ex)
{
- LogRequestFailed(request, ex);
throw ex;
}
@@ -246,7 +213,7 @@ namespace Tango.Integration.Storage
request.Path = path;
request.Length = stream.Length;
- var fileUploadResponse = await _transporter.SendRequest<FileUploadRequest, FileUploadResponse>(request);
+ var fileUploadResponse = await _transporter.SendRequest<FileUploadRequest, FileUploadResponse>(request, new TransportRequestConfig() { ShouldLog = true });
String uploadId = fileUploadResponse.Message.UploadID;
long max_length = fileUploadResponse.Message.MaxChunkLength;
@@ -362,7 +329,7 @@ namespace Tango.Integration.Storage
FileDownloadRequest request = new FileDownloadRequest();
request.FileName = file.Path;
- var fileDownloadResponse = await _transporter.SendRequest<FileDownloadRequest, FileDownloadResponse>(request);
+ var fileDownloadResponse = await _transporter.SendRequest<FileDownloadRequest, FileDownloadResponse>(request, new TransportRequestConfig() { ShouldLog = true });
String download_id = fileDownloadResponse.Message.DownloadID;
long max_length = fileDownloadResponse.Message.MaxChunkLength;
@@ -436,7 +403,7 @@ namespace Tango.Integration.Storage
{
Path = item.Path,
Attribute = item.Attribute,
- });
+ }, new TransportRequestConfig() { ShouldLog = true });
}
/// <summary>
@@ -450,7 +417,7 @@ namespace Tango.Integration.Storage
{
Path = path,
Attribute = FileAttribute.Directory,
- });
+ }, new TransportRequestConfig() { ShouldLog = true });
}
#endregion