using System;
|
using System.Diagnostics;
|
|
namespace CCSTrace.CCS
|
{
|
public class SEventLog
|
{
|
static string sSource = "CCSTrace";
|
static string sLog = "Application";
|
|
public SEventLog()
|
{
|
}
|
|
public void Debug(object message)
|
{
|
if (!EventLog.SourceExists(sSource))
|
EventLog.CreateEventSource(sSource, sLog);
|
|
//EventLog.WriteEntry(sSource, message.ToString());
|
EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.Information, 001);
|
}
|
|
public void Error(object message)
|
{
|
//if (!EventLog.SourceExists(sSource))
|
// EventLog.CreateEventSource(sSource, sLog);
|
|
//EventLog.WriteEntry(sSource, message.ToString());
|
//EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.Error, 001);
|
}
|
|
public void Fatal(object message)
|
{
|
if (!EventLog.SourceExists(sSource))
|
EventLog.CreateEventSource(sSource, sLog);
|
|
//EventLog.WriteEntry(sSource, message.ToString());
|
EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.FailureAudit, 001);
|
}
|
|
public void Info(object message)
|
{
|
//if (!EventLog.SourceExists(sSource))
|
// EventLog.CreateEventSource(sSource, sLog);
|
|
//EventLog.WriteEntry(sSource, message.ToString());
|
//EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.Information, 001);
|
}
|
|
public void Warn(object message)
|
{
|
if (!EventLog.SourceExists(sSource))
|
EventLog.CreateEventSource(sSource, sLog);
|
|
//EventLog.WriteEntry(sSource, message.ToString());
|
EventLog.WriteEntry(sSource, message.ToString(), EventLogEntryType.Warning, 001);
|
}
|
|
public void Close()
|
{
|
}
|
}
|
}
|