Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Cake.Cli/Hosts/BuildScriptHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private async Task<CakeReport> internalRunTargetAsync()

if (report != null && !report.IsEmpty)
{
_reportPrinter.Write(report);
_reportPrinter.Write(report, _log.Verbosity);
}

return report;
Expand Down
12 changes: 11 additions & 1 deletion src/Cake.Cli/Infrastructure/CakeSpectreReportPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ public CakeSpectreReportPrinter(IAnsiConsole console)
}

/// <inheritdoc/>
public void Write(CakeReport report)
public void Write(CakeReport report, Verbosity verbosity)
{
if (report == null)
{
throw new ArgumentNullException(nameof(report));
}

if (verbosity <= Verbosity.Quiet)
{
return;
}

// Create a table
var table = new Table().Border(TableBorder.SimpleHeavy);
table.Width(100);
Expand Down
7 changes: 6 additions & 1 deletion src/Cake.Core/CakeReportPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ public CakeReportPrinter(IConsole console, ICakeContext context)
}

/// <inheritdoc/>
public void Write(CakeReport report)
public void Write(CakeReport report, Verbosity verbosity)
{
if (report == null)
{
throw new ArgumentNullException(nameof(report));
}

if (verbosity <= Verbosity.Quiet)
{
return;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @deniszykov! As you can see in this comment in the original issue we wouldn't want to change the semantics of the Quiet verbosity in order to hide the report - this means users don't have a way to suppress the log messages and see the report anymore.

Could you add a new command-line argument to Cake called --no-report that hides the report? (regardless of the Verbosity)

try
{
var maxTaskNameLength = 29;
Expand Down
3 changes: 2 additions & 1 deletion src/Cake.Core/ICakeReportPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ public interface ICakeReportPrinter
/// Writes the specified report to a target.
/// </summary>
/// <param name="report">The report to write.</param>
void Write(CakeReport report);
/// <param name="verbosity">The <see cref="Verbosity"/> at which the report should be written.</param>
void Write(CakeReport report, Verbosity verbosity);

/// <summary>
/// Writes the specified lifecyle steps (i.e. Setup/TearDown) to a target.
Expand Down