BotGenerator/Generator/Helpers/LoggingHelpers.cs

29 lines
777 B
C#
Raw Normal View History

2021-08-12 16:52:06 +01:00
using System;
namespace Generator.Helpers
{
public static class LoggingHelpers
{
internal static string LogTimeTaken(double totalSeconds)
{
return Math.Round(totalSeconds, 2, MidpointRounding.ToEven).ToString();
}
2021-08-17 18:33:55 +01:00
public static void LogToConsole(string message, ConsoleColor backgroundColour = ConsoleColor.Green)
2021-08-12 16:52:06 +01:00
{
2021-08-17 18:33:55 +01:00
Console.BackgroundColor = backgroundColour;
2021-08-13 16:21:20 +01:00
Console.ForegroundColor = ConsoleColor.Black;
2021-08-12 16:52:06 +01:00
Console.WriteLine(message);
2021-08-13 16:21:20 +01:00
ResetConsoleColours();
}
private static void ResetConsoleColours()
{
Console.BackgroundColor = ConsoleColor.Black;
Console.ForegroundColor = ConsoleColor.White;
2021-08-12 16:52:06 +01:00
}
}
}