init: CATL电池线SCADA首次入库

This commit is contained in:
XingCheng3
2026-06-08 17:12:01 +08:00
commit fe8a3187f5
119 changed files with 42649 additions and 0 deletions

47
MW_Log/LoggerHelper.cs Normal file
View File

@@ -0,0 +1,47 @@
using log4net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MW_Log
{
/// <summary>
/// LoggerHelper
/// </summary>
public class LoggerHelper
{
public static event Action<string,string> ShowMsg; // 显示日志事件
/// <summary>
/// LogInfo
/// </summary>
private static readonly ILog LogInfo = LogManager.GetLogger("LogInfo");
/// <summary>
/// 记录Info日志
/// </summary>
/// <param name="msg"></param>
/// <param name="ex"></param>
public static void Info(string type, string msg, Exception ex = null)
{
if (ex == null) ShowMsg?.Invoke(type, msg);
else ShowMsg?.Invoke(type, ex.Message);
msg = $"【类别:{type}】\r\n【内容】{msg}";
if (ex != null)
{
LogInfo.Info(msg, ex);
}
else
{
LogInfo.Info(msg);
}
}
}
}