Skip to content

Commit 7794ee6

Browse files
committed
unify app output and main logs for MacCatalyst
1 parent 92afa02 commit 7794ee6

File tree

1 file changed

+6
-1
lines changed
  • src/Microsoft.DotNet.XHarness.Apple/AppOperations

1 file changed

+6
-1
lines changed

src/Microsoft.DotNet.XHarness.Apple/AppOperations/AppRunner.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public async Task<ProcessExecutionResult> RunMacCatalystApp(
8484
{
8585
_mainLog.WriteLine($"*** Executing '{appInformation.AppName}' on MacCatalyst ***");
8686
var appOutputLog = _logs.Create(appInformation.BundleIdentifier + ".log", LogType.ApplicationLog.ToString(), timestamp: true);
87+
88+
// The app output log is not directly accessible.
89+
// Hence, we duplicate the log to the main console log to simplify the UX of failure investigation.
90+
IFileBackedLog aggregatedLogAppOutput = Log.CreateReadableAggregatedLog(_mainLog, appOutputLog);
8791

8892
var envVariables = new Dictionary<string, string>();
8993
AddExtraEnvVars(envVariables, extraEnvVariables);
@@ -95,10 +99,11 @@ public async Task<ProcessExecutionResult> RunMacCatalystApp(
9599
}
96100

97101
using (appOutputLog)
102+
using (aggregatedLogAppOutput)
98103
{
99104
return await RunAndWatchForAppSignal(() => RunMacCatalystApp(
100105
appInformation,
101-
appOutputLog,
106+
aggregatedLogAppOutput,
102107
timeout,
103108
waitForExit,
104109
extraAppArguments ?? Enumerable.Empty<string>(),

0 commit comments

Comments
 (0)