LogStudy/LogStudy.EventLog.Next/MinDemo.cs

29 lines
647 B
C#

using System;
using System.Collections.Generic;
using System.Diagnostics.Tracing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LogStudy.EventLog.Next
{
[EventSource(Name = "EventLogNext-MinEventSource")]
public class MinEventSource : EventSource
{
private MinEventSource()
{
}
public static MinEventSource Logger { get; } = new MinEventSource();
[Event(1)]
public void Log(string message, int favoriteNumber)
{
if (IsEnabled())
{
Write(Name, "===================");
}
}
}
}