mirror of
https://github.com/SabreTools/MPF.git
synced 2026-02-03 21:29:27 +00:00
32 lines
870 B
C#
32 lines
870 B
C#
using System;
|
|
using BinaryObjectScanner;
|
|
|
|
namespace MPF.Frontend
|
|
{
|
|
public static class ConsoleLogger
|
|
{
|
|
/// <summary>
|
|
/// Simple process counter to write to console
|
|
/// </summary>
|
|
public static void ProgressUpdated(object? sender, ResultEventArgs value)
|
|
{
|
|
string prefix = (bool?)value switch
|
|
{
|
|
true => "SUCCESS: ",
|
|
false => "FAILURE: ",
|
|
_ => "",
|
|
};
|
|
|
|
Console.WriteLine($"{prefix}{value.Message}");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Simple process counter to write to console
|
|
/// </summary>
|
|
public static void ProgressUpdated(object? sender, ProtectionProgress value)
|
|
{
|
|
Console.WriteLine($"{value.Percentage * 100:N2}%: {value.Filename} - {value.Protection}");
|
|
}
|
|
}
|
|
}
|