Innovenergy_trunk/csharp/App/Collector/src/Utils/Log.cs

39 lines
851 B
C#

namespace InnovEnergy.App.Collector.Utils;
internal static class Log
{
public static void Info(this String l)
{
Console.WriteLine($"[{DateTime.Now.ToLongTimeString()}] {l}");
}
public static void Error(this String l)
{
Console.WriteLine($"[{DateTime.Now.ToLongTimeString()}] {l}");
}
public static void Warning(this String l)
{
Console.WriteLine($"[{DateTime.Now.ToLongTimeString()}] {l}");
}
public static void Debug(this String l)
{
Console.WriteLine($"[{DateTime.Now.ToLongTimeString()}] {l}");
}
public static T Dump<T>(this T t)
{
Console.WriteLine(t);
return t;
}
public static void Dump<T>(this T l, Int32 n)
{
Console.WriteLine(l);
for (var i = 0; i < n; i++)
Console.WriteLine();
}
}