Files
MPF/MPF.Frontend/ConsoleLogger.cs

32 lines
870 B
C#
Raw Permalink Normal View History

2024-06-24 10:37:05 -04:00
using System;
using BinaryObjectScanner;
2024-12-18 22:55:53 -05:00
namespace MPF.Frontend
2024-06-24 10:37:05 -04:00
{
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}");
2024-06-24 10:37:05 -04:00
}
/// <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}");
}
}
}