Skip to content

Commit b43ae88

Browse files
committed
chore: set default diag log level to warning and add --no-launchprofile option
1 parent 6ceaa36 commit b43ae88

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

build/BenchmarkDotNet.Build/Runners/UnitTestRunner.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ public class UnitTestRunner(BuildContext context)
3737

3838
private DotNetRunSettings GetTestSettingsParameters(FilePath logFile, string tfm)
3939
{
40+
// Enabled `Trace` level logging when debug logging is enabled on GitHub Actions.
41+
// https://docs.github.com/en/actions/how-tos/monitor-workflows/enable-debug-logging
42+
var diagnosticVerbosity = context.EnvironmentVariable("ACTIONS_STEP_DEBUG") == "true"
43+
? "Trace"
44+
: "Warning"; // Logging Warning/Error/Critical level logs by default.
45+
4046
var settings = new DotNetRunSettings
4147
{
4248
Configuration = context.BuildConfiguration,
@@ -54,7 +60,8 @@ private DotNetRunSettings GetTestSettingsParameters(FilePath logFile, string tfm
5460
.AppendSwitch("--output", "Detailed")
5561
.AppendSwitch("--show-stdout", "Failed")
5662
.Append("--diagnostic")
57-
.AppendSwitch("--diagnostic-verbosity", "Trace")
63+
.AppendSwitch("--diagnostic-verbosity", diagnosticVerbosity)
64+
.Append("--no-launch-profile"),
5865
};
5966
return settings;
6067
}

0 commit comments

Comments
 (0)