36 lines
879 B
C#
36 lines
879 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace ebbits {
|
|
class Logger {
|
|
public static void Info(string msg) {
|
|
Logger.Message(msg, "INFO");
|
|
}
|
|
private static void Message(string msg, string type) {
|
|
DateTime d = DateTime.Now;
|
|
Console.WriteLine("[" + d.ToLongTimeString() + "." + d.Millisecond.ToString().PadLeft(3,'0') + "] " + type + ": " + msg);
|
|
}
|
|
|
|
public static void Notice(string msg) {
|
|
Logger.Message(msg, "NOTICE");
|
|
}
|
|
|
|
public static void Warn(string msg) {
|
|
Logger.Message(msg, "WARN");
|
|
}
|
|
|
|
public static void Message(string msg) {
|
|
Logger.Message(msg, "MESSAGE");
|
|
}
|
|
|
|
public static bool LogSerial { get; set; }
|
|
|
|
public static void Serial(string dir, string msg) {
|
|
if(LogSerial) {
|
|
Logger.Message(msg, "SERIAL "+dir.ToUpper());
|
|
}
|
|
}
|
|
}
|
|
}
|