2022-05-19 14:41:44 +01:00
|
|
|
|
using Spectre.Console;
|
2022-05-13 22:41:15 +01:00
|
|
|
|
|
2022-05-14 02:58:38 +01:00
|
|
|
|
namespace SPT_AKI_Installer.Aki.Helper
|
2022-05-13 22:41:15 +01:00
|
|
|
|
{
|
|
|
|
|
public static class LogHelper
|
|
|
|
|
{
|
2022-05-14 02:58:38 +01:00
|
|
|
|
private static void Log(string tag, string message, string foreground, string background = "black")
|
|
|
|
|
{
|
|
|
|
|
AnsiConsole.MarkupLine($"[{foreground} on {background}][[{tag}]]: {message.EscapeMarkup()}[/]");
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-13 22:41:15 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Outputs a string to console starting with [USER] with
|
2022-05-14 12:19:40 +01:00
|
|
|
|
/// Green text
|
2022-05-13 22:41:15 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static void User(string text)
|
|
|
|
|
{
|
2022-05-14 02:58:38 +01:00
|
|
|
|
Log("USER", text, "green");
|
2022-05-13 22:41:15 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Outputs a string to console starting with [WARNING] with
|
2022-05-14 12:19:40 +01:00
|
|
|
|
/// Yellow text
|
2022-05-13 22:41:15 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static void Warning(string text)
|
|
|
|
|
{
|
2022-05-14 02:58:38 +01:00
|
|
|
|
Log("WARNING", text, "yellow");
|
2022-05-13 22:41:15 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Outputs a string to console starting with [ERROR] with
|
2022-05-14 12:19:40 +01:00
|
|
|
|
/// Red text
|
2022-05-13 22:41:15 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static void Error(string text)
|
|
|
|
|
{
|
2022-05-14 02:58:38 +01:00
|
|
|
|
Log("ERROR", text, "red");
|
2022-05-13 22:41:15 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Outputs a string to console starting with [INFO] with
|
2022-05-14 12:19:40 +01:00
|
|
|
|
/// Blue text
|
2022-05-13 22:41:15 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static void Info(string text)
|
|
|
|
|
{
|
2022-05-14 02:58:38 +01:00
|
|
|
|
Log("INFO", text, "blue");
|
2022-05-13 22:41:15 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|