mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
Added a new favicon/icon Add more checks before uploading a paste, changed alert to use the showNotification function Added password modal for private pastes instead of using alert Fix a paste page navigation in dashboard Improve auth css
31 lines
1.1 KiB
C#
31 lines
1.1 KiB
C#
namespace SharpbinV2.Server
|
|
{
|
|
public class Logging
|
|
{
|
|
public Logging()
|
|
{
|
|
if (!Directory.Exists("logs"))
|
|
Directory.CreateDirectory("logs");
|
|
}
|
|
public void LogInfo(string message)
|
|
{
|
|
Console.WriteLine($"[{DateTime.Now} INFO] {message}");
|
|
File.AppendAllText($"logs/{DateTime.Now.ToString("yyyy-MM-dd")}.log", $"[{DateTime.Now} INFO] {message}\n");
|
|
}
|
|
public void LogWarning(string message)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Yellow;
|
|
Console.WriteLine($"[{DateTime.Now} WARNING] {message}");
|
|
File.AppendAllText($"logs/{DateTime.Now.ToString("yyyy-MM-dd")}.log", $"[{DateTime.Now} WARNING] {message}\n");
|
|
Console.ResetColor();
|
|
}
|
|
public void LogError(string message)
|
|
{
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
Console.WriteLine($"[{DateTime.Now} ERROR] {message}");
|
|
File.AppendAllText($"logs/{DateTime.Now.ToString("yyyy-MM-dd")}.log", $"[{DateTime.Now} ERROR] {message}\n");
|
|
Console.ResetColor();
|
|
}
|
|
}
|
|
}
|