servuo/Server/EventLog.cs
2013-10-28 07:09:42 +00:00

56 lines
No EOL
1.2 KiB
C#

#region Header
// **********
// ServUO - EventLog.cs
// **********
#endregion
#region References
using System;
using System.Diagnostics;
using DiagELog = System.Diagnostics.EventLog;
#endregion
namespace Server
{
public static class EventLog
{
static EventLog()
{
if (!DiagELog.SourceExists("RunUO"))
{
DiagELog.CreateEventSource("RunUO", "Application");
}
}
public static void Error(int eventID, string text)
{
DiagELog.WriteEntry("RunUO", text, EventLogEntryType.Error, eventID);
}
public static void Error(int eventID, string format, params object[] args)
{
Error(eventID, String.Format(format, args));
}
public static void Warning(int eventID, string text)
{
DiagELog.WriteEntry("RunUO", text, EventLogEntryType.Warning, eventID);
}
public static void Warning(int eventID, string format, params object[] args)
{
Warning(eventID, String.Format(format, args));
}
public static void Inform(int eventID, string text)
{
DiagELog.WriteEntry("RunUO", text, EventLogEntryType.Information, eventID);
}
public static void Inform(int eventID, string format, params object[] args)
{
Inform(eventID, String.Format(format, args));
}
}
}