This repository has been archived on 2025-09-07. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
dotnet-installer/scripts/Microsoft.DotNet.Cli.Build.Framework/BuildReporter.cs
2016-02-12 15:26:35 -08:00

27 lines
830 B
C#

using System;
namespace Microsoft.DotNet.Cli.Build.Framework
{
public static class BuildReporter
{
public static void BeginSection(string type, string name)
{
Reporter.Output.WriteLine($"[{type.PadRight(10)} >]".Green() + $" [....] [{DateTime.Now:O}]".Blue() + $" {name}");
}
public static void EndSection(string type, string name, bool success)
{
var header = $"[{type.PadRight(10)} <]";
if(success)
{
header = header.Green();
}
else
{
header = header.Red();
}
var successString = success ? " OK " : "FAIL";
Reporter.Output.WriteLine(header + $" [{successString}] [{DateTime.Now:O}]".Blue() + $" {name}");
}
}
}