提交 9096b84d 编写于 作者: S Sam Harwell

Take screenshot after writing logs

This change ensures that logs are created even if the application fails
to capture a screenshot.
上级 ce0897aa
......@@ -73,7 +73,7 @@ private static void FirstChanceExceptionHandler(object sender, FirstChanceExcept
baseFileName = $"{testName}-{eventArgs.Exception.GetType().Name}-{DateTime.Now:HH.mm.ss}";
}
ScreenshotService.TakeScreenshot(Path.Combine(logDir, $"{baseFileName}.png"));
Directory.CreateDirectory(logDir);
var exception = eventArgs.Exception;
File.WriteAllText(
......@@ -82,6 +82,8 @@ private static void FirstChanceExceptionHandler(object sender, FirstChanceExcept
EventLogCollector.TryWriteDotNetEntriesToFile(Path.Combine(logDir, $"{baseFileName}.DotNet.log"));
EventLogCollector.TryWriteWatsonEntriesToFile(Path.Combine(logDir, $"{baseFileName}.Watson.log"));
ScreenshotService.TakeScreenshot(Path.Combine(logDir, $"{baseFileName}.png"));
}
finally
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册