Skip to content

Commit 09774ba

Browse files
kotlarmilosCopilot
andauthored
Reduce mlaunch default verbosity from 5 to 2 (#1561)
* Reduce mlaunch default verbosity from 5 to 2 The default verbosity of 5 causes mlaunch to pass five -v flags to devicectl, producing massive debug output (full device property trees, connection details, capabilities) that clutters console logs. Reducing to 2 keeps useful diagnostic info while removing the noise. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Reduce logging verbosity by filtering out system logs in TestOrchestrator and adding a separate process log in AppBundleInformationParser. * Reduce logging verbosity in MlaunchProcessManager and IMlaunchProcessManager by setting default verbosity to 0 --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 581c6a9 commit 09774ba

5 files changed

Lines changed: 12 additions & 11 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ public async Task<ProcessExecutionResult> InstallApp(
6767
var totalSize = Directory.GetFiles(appBundleInformation.LaunchAppPath, "*", SearchOption.AllDirectories).Select((v) => new FileInfo(v).Length).Sum();
6868
_mainLog.WriteLine($"Installing '{appBundleInformation.LaunchAppPath}' to '{device.Name}' ({totalSize / 1024.0 / 1024.0:N2} MB)");
6969

70-
return await _processManager.ExecuteCommandAsync(args, _mainLog, TimeSpan.FromMinutes(15), verbosity: 2, cancellationToken: cancellationToken);
70+
return await _processManager.ExecuteCommandAsync(args, _mainLog, TimeSpan.FromMinutes(15), cancellationToken: cancellationToken);
7171
}
7272
}

src/Microsoft.DotNet.XHarness.Apple/Orchestration/TestOrchestrator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ ExitCode LogProblem(string message, ExitCode defaultExitCode)
384384
/// </summary>
385385
private void CopyLogsToMainLog()
386386
{
387-
var logs = _logs.Where(log => log.Description == LogType.SystemLog.ToString() || log.Description == LogType.ApplicationLog.ToString()).ToList();
387+
var logs = _logs.Where(log => log.Description == LogType.ApplicationLog.ToString()).ToList();
388388

389389
foreach (var log in logs)
390390
{

src/Microsoft.DotNet.XHarness.iOS.Shared/AppBundleInformationParser.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ private async Task<string> GetPlistProperty(
175175
};
176176

177177
var commandOutput = new MemoryLog { Timestamp = false };
178+
var processLog = new MemoryLog { Timestamp = false };
178179
var result = await _processManager.ExecuteCommandAsync(
179180
PlistBuddyPath,
180181
args,
181-
log,
182+
processLog,
182183
commandOutput,
183184
commandOutput,
184185
TimeSpan.FromSeconds(10),

src/Microsoft.DotNet.XHarness.iOS.Shared/Execution/IMlaunchProcessManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Task<ProcessExecutionResult> ExecuteCommandAsync(
2222
ILog log,
2323
TimeSpan timeout,
2424
Dictionary<string, string>? environmentVariables = null,
25-
int verbosity = 5,
25+
int verbosity = 0,
2626
CancellationToken? cancellationToken = null);
2727

2828
Task<ProcessExecutionResult> ExecuteCommandAsync(
@@ -32,7 +32,7 @@ Task<ProcessExecutionResult> ExecuteCommandAsync(
3232
ILog stderrLog,
3333
TimeSpan timeout,
3434
Dictionary<string, string>? environmentVariables = null,
35-
int verbosity = 5,
35+
int verbosity = 0,
3636
CancellationToken? cancellationToken = null);
3737

3838
Task<ProcessExecutionResult> RunAsync(
@@ -41,7 +41,7 @@ Task<ProcessExecutionResult> RunAsync(
4141
ILog log,
4242
TimeSpan? timeout = null,
4343
Dictionary<string, string>? environmentVariables = null,
44-
int verbosity = 5,
44+
int verbosity = 0,
4545
CancellationToken? cancellationToken = null,
4646
bool? diagnostics = null);
4747

@@ -53,7 +53,7 @@ Task<ProcessExecutionResult> RunAsync(
5353
ILog stderrLog,
5454
TimeSpan? timeout = null,
5555
Dictionary<string, string>? environmentVariables = null,
56-
int verbosity = 5,
56+
int verbosity = 0,
5757
CancellationToken? cancellationToken = null,
5858
bool? diagnostics = null);
5959
}

src/Microsoft.DotNet.XHarness.iOS.Shared/Execution/MlaunchProcessManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public async Task<ProcessExecutionResult> ExecuteCommandAsync(
3232
ILog log,
3333
TimeSpan timeout,
3434
Dictionary<string, string>? environmentVariables = null,
35-
int verbosity = 5,
35+
int verbosity = 0,
3636
CancellationToken? cancellationToken = null)
3737
{
3838
using var p = new Process();
@@ -46,7 +46,7 @@ public async Task<ProcessExecutionResult> ExecuteCommandAsync(
4646
ILog stderr,
4747
TimeSpan timeout,
4848
Dictionary<string, string>? environmentVariables = null,
49-
int verbosity = 5,
49+
int verbosity = 0,
5050
CancellationToken? cancellationToken = null)
5151
{
5252
using var p = new Process();
@@ -59,7 +59,7 @@ public Task<ProcessExecutionResult> RunAsync(
5959
ILog log,
6060
TimeSpan? timeout = null,
6161
Dictionary<string, string>? environmentVariables = null,
62-
int verbosity = 5,
62+
int verbosity = 0,
6363
CancellationToken? cancellationToken = null,
6464
bool? diagnostics = null) =>
6565

@@ -73,7 +73,7 @@ public Task<ProcessExecutionResult> RunAsync(
7373
ILog stderr,
7474
TimeSpan? timeout = null,
7575
Dictionary<string, string>? environmentVariables = null,
76-
int verbosity = 5,
76+
int verbosity = 0,
7777
CancellationToken? cancellationToken = null,
7878
bool? diagnostics = null)
7979
{

0 commit comments

Comments
 (0)