using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LogStudy.EventLog.Next { /// /// 示例执行器 /// public static class Runner { /// /// 运行:最小示例 /// public static void RunMinEventSource() { //Console.WriteLine($"开始运行:最小示例"); MinEventSource.Logger.Log("MinEventSource info:--------------------------------------------", 12); //Console.WriteLine($"运行结束:最小示例"); } /// /// 自定义:事件ID、日志等级、关键字 /// public static void RunCustomEventSource() { CustomEventSource.Logger.AppStarted("CustomEventSource: AppStarted",22); CustomEventSource.Logger.RequestStart(2); CustomEventSource.Logger.RequestStop(2); CustomEventSource.Logger.AppStopd(message: "CustomEventSource:AppStopd"); } /// /// 高级自定义 /// public static void RunAdvancedEventSource() { AdvancedEventSource.Logger.RequestStart(2,"localhost"); AdvancedEventSource.Logger.RequestStop(2); } /// /// 实现接口 /// public static void RunInterfaceEventSource() { ILogger logger = InterfaceEventSource.Logger; logger.Warning("InterfaceEventSource 警告信息!"); logger.Error(400, "InterfaceEventSource 错误信息!"); } } }