2024-10-29 09:10:37 +00:00
|
|
|
using Microsoft.Extensions.Logging;
|
2022-08-21 07:33:27 +00:00
|
|
|
using System;
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
|
|
namespace SupportChild;
|
|
|
|
|
|
|
|
public static class Logger
|
|
|
|
{
|
2024-10-29 09:10:37 +00:00
|
|
|
public static void Debug(string message)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
SupportChild.discordClient.Logger.Log(LogLevel.Debug, new EventId(420, Assembly.GetEntryAssembly()?.GetName().Name), message);
|
|
|
|
}
|
|
|
|
catch (NullReferenceException)
|
|
|
|
{
|
|
|
|
Console.WriteLine("[DEBUG] " + message);
|
|
|
|
}
|
|
|
|
}
|
2022-08-21 07:33:27 +00:00
|
|
|
|
2024-10-29 09:10:37 +00:00
|
|
|
public static void Log(string message)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
SupportChild.discordClient.Logger.Log(LogLevel.Information, new EventId(420, Assembly.GetEntryAssembly()?.GetName().Name), message);
|
|
|
|
}
|
|
|
|
catch (NullReferenceException)
|
|
|
|
{
|
|
|
|
Console.WriteLine("[INFO] " + message);
|
|
|
|
}
|
|
|
|
}
|
2022-08-21 07:33:27 +00:00
|
|
|
|
2024-10-29 09:10:37 +00:00
|
|
|
public static void Warn(string message)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
SupportChild.discordClient.Logger.Log(LogLevel.Warning, new EventId(420, Assembly.GetEntryAssembly()?.GetName().Name), message);
|
|
|
|
}
|
|
|
|
catch (NullReferenceException)
|
|
|
|
{
|
|
|
|
Console.WriteLine("[WARNING] " + message);
|
|
|
|
}
|
|
|
|
}
|
2022-08-21 07:33:27 +00:00
|
|
|
|
2024-10-29 09:10:37 +00:00
|
|
|
public static void Error(string message)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
SupportChild.discordClient.Logger.Log(LogLevel.Error, new EventId(420, Assembly.GetEntryAssembly()?.GetName().Name), message);
|
|
|
|
}
|
|
|
|
catch (NullReferenceException)
|
|
|
|
{
|
|
|
|
Console.WriteLine("[ERROR] " + message);
|
|
|
|
}
|
|
|
|
}
|
2022-08-21 07:33:27 +00:00
|
|
|
|
2024-10-29 09:10:37 +00:00
|
|
|
public static void Fatal(string message)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
SupportChild.discordClient.Logger.Log(LogLevel.Critical, new EventId(420, Assembly.GetEntryAssembly()?.GetName().Name), message);
|
|
|
|
}
|
|
|
|
catch (NullReferenceException)
|
|
|
|
{
|
|
|
|
Console.WriteLine("[CRITICAL] " + message);
|
|
|
|
}
|
|
|
|
}
|
2022-08-21 07:33:27 +00:00
|
|
|
}
|