public void Add(string message, EnumLog type = EnumLog.Information) { if (!message.isNullOrEmpty()) { Log.Add(new LogModel { Message = message, Step = $"PASSO {Log.Count.ToString()}", LogType = type, FileType = ProcessType }); } }
/// <summary> /// 写日志 /// </summary> /// <param name="type">日志类型</param> /// <param name="msg">消息</param> private static void WriteLog(EnumLog type, string msg) { switch (type) { case EnumLog.Error: LogManager.GetLogger("Error").Debug(msg); break; case EnumLog.Info: LogManager.GetLogger("Info").Debug(msg); break; default: LogManager.GetLogger("Default").Debug(msg); break; } }