Initial import

This commit is contained in:
Doug Macintosh
2026-01-04 10:55:36 -05:00
commit a59a047cd1
54 changed files with 107364 additions and 0 deletions

92
Logger.cs Executable file
View File

@@ -0,0 +1,92 @@
namespace bdf
{
using System;
using System.Text;
internal static class Logger
{
public static void Log(uint level, string format, params object[] objs)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("[{0}] ", DateTime.Now);
try
{
sb.AppendFormat(format, objs);
}
catch (Exception e)
{
Console.WriteLine("Logger: invalid parameters for formatting. {0}:{1}", e.Message, e.InnerException.Message);
}
if (level <= bdf.debug )
{
Console.WriteLine(sb.ToString());
bdf.outfile.WriteLine(sb.ToString());
}
if (level <= bdf.adlvl )
{
bdf.adminLog.AppendLine(sb.ToString());
}
}
/*
public static void Log(uint level, string format, string s1, string s2)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("[{0}] ", DateTime.Now);
sb.AppendFormat(format, s1, s2);
if (level <= bdf.debug )
{
Console.WriteLine(sb.ToString());
bdf.outfile.WriteLine(sb.ToString());
}
if (level <= bdf.adlvl )
{
bdf.adminLog.AppendLine(sb.ToString());
}
}
public static void Log(uint level, string format, string s1)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("[{0}] ", DateTime.Now);
sb.AppendFormat(format, s1);
if (level <= bdf.debug )
{
Console.WriteLine(sb.ToString());
bdf.outfile.WriteLine(sb.ToString());
}
if (level <= bdf.adlvl )
{
bdf.adminLog.AppendLine(sb.ToString());
}
}
public static void Log(uint level, string message)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("[{0}] {1}", DateTime.Now, message);
if (level <= bdf.debug )
{
Console.WriteLine(sb.ToString());
bdf.outfile.WriteLine(sb.ToString());
}
if (level <= bdf.adlvl )
{
bdf.adminLog.AppendLine(sb.ToString());
}
}
*/
public static void Log(string message)
{
StringBuilder sb = new StringBuilder();
sb.AppendFormat("[{0}] {1}", DateTime.Now, message);
Console.WriteLine(sb.ToString());
bdf.outfile.WriteLine(sb.ToString());
bdf.adminLog.AppendLine(sb.ToString());
}
}
}