namespace IStation.Application { /// /// /// public class ScheduleLog { private static readonly string info_folder = "Schedule\\Info"; private static readonly string debug_folder = "Schedule\\Debug"; private static readonly string error_folder = "Schedule\\Error"; /// /// 写入信息日志 /// /// /// /// public static void Info(long requestId, string title, string info) { Yw.LogHelper.Custom(info_folder,GetLogInfo(requestId, title, info)); } /// /// 写入调试日志 /// /// /// /// public static void Debug(long requestId, string title, string info) { Yw.LogHelper.Custom(debug_folder, GetLogInfo(requestId, title, info)); } /// /// 写入错误日志 /// /// /// /// /// public static void Error(long requestId, string title, string info, Exception ex = null) { Yw.LogHelper.Custom(error_folder,GetLogInfo(requestId, title, info, ex)); } /// /// /// /// /// /// /// private static string GetLogInfo(long requestId, string title, string info) { return $"{requestId}-{title} >> {info}"; } /// /// /// /// /// /// /// /// private static string GetLogInfo(long requestId, string title, string info, Exception ex) { return $"{requestId}-{title} >> {info} >> ({ex.Message})"; } } }