mirror of
https://github.com/islehorse/HISP.git
synced 2025-06-06 02:51:27 +12:00
Add Feature pt1
This commit is contained in:
parent
a184e4d735
commit
092534e331
131 changed files with 3113 additions and 1418 deletions
46
HorseIsleServer/LibHISP/Server/Logger.cs
Normal file
46
HorseIsleServer/LibHISP/Server/Logger.cs
Normal file
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
|
||||
namespace HISP.Server
|
||||
{
|
||||
public class Logger
|
||||
{
|
||||
private static void defaultCallbackFunc(string txt)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
private static Action<string> logFunction = defaultCallbackFunc;
|
||||
|
||||
|
||||
public static void SetCallback(Action<string> callback)
|
||||
{
|
||||
logFunction = callback;
|
||||
}
|
||||
|
||||
public static void ErrorPrint(string text)
|
||||
{
|
||||
if (ConfigReader.LogLevel >= 1)
|
||||
logFunction("[ERROR] " + text);
|
||||
}
|
||||
public static void WarnPrint(string text)
|
||||
{
|
||||
if (ConfigReader.LogLevel >= 2)
|
||||
logFunction("[WARN] " + text);
|
||||
}
|
||||
public static void HackerPrint(string text)
|
||||
{
|
||||
if (ConfigReader.LogLevel >= 3)
|
||||
logFunction("[HACK] " + text);
|
||||
}
|
||||
public static void InfoPrint(string text)
|
||||
{
|
||||
if (ConfigReader.LogLevel >= 4)
|
||||
logFunction("[INFO] " + text);
|
||||
}
|
||||
public static void DebugPrint(string text)
|
||||
{
|
||||
if (ConfigReader.LogLevel >= 5)
|
||||
logFunction("[DEBUG] " + text);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue