generated from noisedestroyers/claude
updated db schema def
This commit is contained in:
40
legacy/CCNetLogReader/CCNetLogReader/Logging.cs
Normal file
40
legacy/CCNetLogReader/CCNetLogReader/Logging.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace CCNetLogReader
|
||||
{
|
||||
public static class Logger
|
||||
{
|
||||
public static void Error(string message, string module="")
|
||||
{
|
||||
WriteEntry(message, "error", module);
|
||||
}
|
||||
|
||||
public static void Error(Exception ex, string module = "")
|
||||
{
|
||||
WriteEntry(ex.Message, "error", module);
|
||||
}
|
||||
|
||||
public static void Warning(string message, string module = "")
|
||||
{
|
||||
WriteEntry(message, "warning", module);
|
||||
}
|
||||
|
||||
public static void Info(string message, string module = "")
|
||||
{
|
||||
WriteEntry(message, "info", module);
|
||||
}
|
||||
|
||||
private static void WriteEntry(string message, string type, string module = "")
|
||||
{
|
||||
string text = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}\t{type}\t{message}";
|
||||
|
||||
Trace.WriteLine(text, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user