diff --git a/SRC/MESAgent/AutoLoaderLib/AutoLoaderLib_C.csproj b/SRC/MESAgent/AutoLoaderLib/AutoLoaderLib_C.csproj index 5f76bc4..589129c 100644 --- a/SRC/MESAgent/AutoLoaderLib/AutoLoaderLib_C.csproj +++ b/SRC/MESAgent/AutoLoaderLib/AutoLoaderLib_C.csproj @@ -121,6 +121,10 @@ False ..\..\MES_S_DLL\iMESConst.dll + + False + ..\..\MES_S_DLL\iMESLog.dll + False diff --git a/SRC/MESAgent/AutoLoaderLib/clsAutoLoaderLibrary.cs b/SRC/MESAgent/AutoLoaderLib/clsAutoLoaderLibrary.cs index 3e6ef8b..a46c232 100644 --- a/SRC/MESAgent/AutoLoaderLib/clsAutoLoaderLibrary.cs +++ b/SRC/MESAgent/AutoLoaderLib/clsAutoLoaderLibrary.cs @@ -143,7 +143,7 @@ namespace AutoLoaderLib_C string strComponentNo = string.Empty; bool blnMoveFile = true; string strSQL = string.Empty; - + modWIN.WriteLog("开始读档:" + Path.GetFileName(FileName), iMESLog.iMESLogLevel.Trace); try { // //取出colParameter傳入參數 diff --git a/SRC/MESAgent/AutoLoaderLib/modWIN.cs b/SRC/MESAgent/AutoLoaderLib/modWIN.cs index cd62db0..b033a7f 100644 --- a/SRC/MESAgent/AutoLoaderLib/modWIN.cs +++ b/SRC/MESAgent/AutoLoaderLib/modWIN.cs @@ -6,6 +6,7 @@ using System.Runtime.InteropServices; using Microsoft.VisualBasic; using Microsoft.VisualBasic.CompilerServices; using static iMESCore.Base.iMESConst; +using System.Diagnostics; namespace AutoLoaderLib_C { @@ -487,6 +488,15 @@ namespace AutoLoaderLib_C return GetExceptionStackRet; } + public static void WriteLog(string msg, iMESLog.iMESLogLevel level, Exception e = null) + { + string MethodInfo = ""; + var ss = new StackTrace(true); + var mb = ss.GetFrame(1).GetMethod(); + MethodInfo = mb.DeclaringType.Namespace + "." + mb.DeclaringType.Name + "." + mb.Name; + var log = new iMESLog.MESLog(mb.DeclaringType.Namespace); + log.WriteLog(msg, level, e, MethodInfo); + } } } \ No newline at end of file