-
Notifications
You must be signed in to change notification settings - Fork 0
/
JEventSource.cs
47 lines (41 loc) · 1.17 KB
/
JEventSource.cs
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
using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace JGitEventViewer
{
/**
* Logging class based on Sample https://code.msdn.microsoft.com/windowsapps/Logging-Sample-for-Windows-0b9dffd7#content
*/
sealed class JEventSource : EventSource
{
public static JEventSource Log = new JEventSource();
[Event(1, Level = EventLevel.Verbose)]
public void Debug(string message)
{
this.WriteEvent(1, message);
}
[Event(2, Level = EventLevel.Informational)]
public void Info(string message)
{
this.WriteEvent(2, message);
}
[Event(3, Level = EventLevel.Warning)]
public void Warn(string message)
{
this.WriteEvent(3, message);
}
[Event(4, Level = EventLevel.Error)]
public void Error(string message)
{
this.WriteEvent(4, message);
}
[Event(5, Level = EventLevel.Critical)]
public void Critical(string message)
{
this.WriteEvent(5, message);
}
}
}