hank
2015-08-18 2d4b747b3ac277babbd8eddfd88f378953f497bd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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()
        {
        }
    }
}