示例#1
0
        internal void WriteLog(string Message, LoggerWarringLevel Level = LoggerWarringLevel.RegularMessage, LoggerLogType Type = LoggerLogType.All)
        {
            switch (Type)
            {
            case LoggerLogType.All:
                WriteLocalLogEntry(Message, Level);
                WriteServerLogEntry(Message, Level);
                WriteWindowsLogEntry(Message, Level);
                break;

            case LoggerLogType.LocalLog:
                WriteLocalLogEntry(Message, Level);
                break;

            case LoggerLogType.ServerLog:
                WriteServerLogEntry(Message, Level);
                break;

            case LoggerLogType.WindowsLog:
                WriteWindowsLogEntry(Message, Level);
                break;

            case LoggerLogType.LocalLog | LoggerLogType.ServerLog:
                WriteLocalLogEntry(Message);
                WriteServerLogEntry(Message, Level);
                break;

            case LoggerLogType.LocalLog | LoggerLogType.WindowsLog:
                WriteLocalLogEntry(Message, Level);
                WriteWindowsLogEntry(Message, Level);
                break;

            case LoggerLogType.ServerLog | LoggerLogType.WindowsLog:
                WriteServerLogEntry(Message, Level);
                WriteWindowsLogEntry(Message, Level);
                break;
            }
            WriteConsole(Message, Level);
        }
示例#2
0
        internal void WriteConsole(string Message, LoggerWarringLevel Level = LoggerWarringLevel.RegularMessage)
        {
#if DEBUG
            lock (ArcadeServiceEventEventLog)
                try
                {
                    ConsoleColor ReturnColor = Console.ForegroundColor;
                    switch (Level)
                    {
                    case LoggerWarringLevel.RegularMessage:
                        Console.ForegroundColor = ConsoleColor.White;
                        Console.WriteLine(BuildLogString(Message, Level));
                        Console.ForegroundColor = ReturnColor;
                        break;

                    case LoggerWarringLevel.Warring:
                        Console.ForegroundColor = ConsoleColor.Yellow;
                        Console.WriteLine(BuildLogString(Message, Level));
                        Console.ForegroundColor = ReturnColor;
                        break;

                    case LoggerWarringLevel.Danger:
                        Console.ForegroundColor = ConsoleColor.Red;
                        Console.WriteLine(BuildLogString(Message, Level));
                        Console.ForegroundColor = ReturnColor;
                        break;

                    case LoggerWarringLevel.CriticalError:
                        Console.ForegroundColor = ConsoleColor.Magenta;
                        Console.WriteLine(BuildLogString(Message, Level));
                        Console.ForegroundColor = ReturnColor;
                        break;
                    }
                } catch {}
#endif
        }
示例#3
0
 string BuildLogString(string Message, LoggerWarringLevel Level)
 {
     return("<" + Level + " Time=\"" + DateTime.UtcNow + "\">" + Message + "</" + Level + ">");
 }
示例#4
0
 internal void WriteServerLogEntry(string Message, LoggerWarringLevel Level = LoggerWarringLevel.RegularMessage)
 {
     //throw new NotImplementedException();
 }
示例#5
0
 internal void WriteLocalLogEntry(string Message, LoggerWarringLevel Level = LoggerWarringLevel.RegularMessage)
 {
     lock (ArcadeServiceEventEventLog)
         using (StreamWriter SW = new StreamWriter(LocalLog, true))
             SW.WriteLine(BuildLogString(Message, Level));
 }
示例#6
0
 internal void WriteWindowsLogEntry(string Message, LoggerWarringLevel Level = LoggerWarringLevel.RegularMessage)
 {
     //lock(ArcadeServiceEventEventLog)
     //    ArcadeServiceEventEventLog.WriteEntry(BuildLogString(Message, Level));
 }