diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-02 14:44:09 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-02 14:44:09 +0300 |
| commit | c45e816908048bb7b621759c0b0f1391d7d85b0b (patch) | |
| tree | ea6758624f5d4338960fa0581fece1b7ddfe11db /Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting | |
| parent | 565afd35baab8b2846ebc80a6802a375b3fd876e (diff) | |
| download | Tango-c45e816908048bb7b621759c0b0f1391d7d85b0b.tar.gz Tango-c45e816908048bb7b621759c0b0f1391d7d85b0b.zip | |
Fixed error info on MachineService errors.
Some work on TFS PPC client logging.
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting')
| -rw-r--r-- | Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs index 56a94afef..52867c65f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.BugReporting/TFS/TeamFoundationServicePPCClient.cs @@ -55,8 +55,12 @@ namespace Tango.PPC.BugReporting.TFS public async Task SubmitBug(String title, String steps, TeamMember createdBy, TeamMember assignedTo, Severity severity) { + LogManager.Log("Submitting bug report..."); + WorkItem item = new WorkItem(); + var tempFolder = TemporaryManager.CreateFolder(); + await Task.Factory.StartNew(() => { item.Title = title; @@ -80,10 +84,10 @@ namespace Tango.PPC.BugReporting.TFS FileLogger appFileLogger = LogManager.Default.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; FileLogger embeddedFileLogger = MachineOperator.EmbeddedLogManager.RegisteredLoggers.FirstOrDefault(x => x.GetType() == typeof(FileLogger)) as FileLogger; - var tempFolder = TemporaryManager.CreateFolder(); - if (appFileLogger != null) { + LogManager.Log($"Attaching application log file ${appFileLogger.LogFile}"); + var appLogFile = tempFolder.CreateImaginaryFile(); File.Copy(appFileLogger.LogFile, appLogFile.Path); @@ -97,6 +101,8 @@ namespace Tango.PPC.BugReporting.TFS if (embeddedFileLogger != null && File.Exists(embeddedFileLogger.LogFile)) { + LogManager.Log($"Attaching embedded log file ${embeddedFileLogger.LogFile}"); + var embeddedLogFile = tempFolder.CreateImaginaryFile(); File.Copy(embeddedFileLogger.LogFile, embeddedLogFile.Path); @@ -116,8 +122,12 @@ namespace Tango.PPC.BugReporting.TFS IMachineOperator op = _machineProvider.MachineOperator; + LogManager.Log("Checking machine status..."); + if (op.Status != MachineStatuses.Disconnected) { + LogManager.Log("Machine is connected. Getting device information and configurations..."); + Machine machine = _machineProvider.Machine; sysModel.Machine = machine; @@ -135,9 +145,15 @@ namespace Tango.PPC.BugReporting.TFS sysModel.LoadedHardwareConfigurationString = op.CurrentHardwareConfiguration.ToJsonString(); } } + else + { + LogManager.Log("Machine is disconnected."); + } String html = String.Empty; + LogManager.Log("Generating HTML system information from template..."); + using (var stream = EmbeddedResourceHelper.GetEmbeddedResourceStream("Tango.PPC.BugReporting.TFS.SystemInformationTemplate.cshtml")) { StreamReader reader = new StreamReader(stream); @@ -149,7 +165,13 @@ namespace Tango.PPC.BugReporting.TFS item.StepsToReproduce = String.Format("<div style=\"white-space:pre\">{0}</div>", item.StepsToReproduce); }); + LogManager.Log("Uploading work item..."); await UploadWorkItem(Project, item); + + LogManager.Log("Deleting temporary folder..."); + await tempFolder.DeleteAsync(); + + LogManager.Log("Upload completed."); } } } |
