mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
Split code into classes to make the codebase look cleaner
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
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user