ulysseskao
2016-04-29 b0c18d369abd06075c83759b0e19823c2a11d716
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
using System.Diagnostics;
 
namespace CCSTrace.CCS
{
    public class SEventLog
    {
        private const string SSource = "CCSTrace";
        private const 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()
        {
        }
    }
}