Commit dbc54187 LN

增加日志打印

1 个父辈 2f452eb6
......@@ -167,7 +167,7 @@ namespace OnlineStore.ACSingleStore
try
{
TimeSpan sp = DateTime.Now - lastLogTime;
if (sp.TotalMinutes >= 1)
if (sp.TotalMinutes >= 5)
{
lastLogTime = DateTime.Now;
......@@ -193,7 +193,8 @@ namespace OnlineStore.ACSingleStore
}
}
private void timer1_Tick(object sender, EventArgs e)
{
{
LogM();
if (!this.Visible)
{
return;
......
......@@ -104,18 +104,21 @@ namespace OnlineStore.ACSingleStore
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
LogUnhandledException(e.ExceptionObject);
LogUnhandledException("CurrentDomain_UnhandledException", e.ToString() + "" + e.ExceptionObject.ToString() + " ");
}
static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
{
LogUnhandledException(e.Exception);
LogUnhandledException("Application_ThreadException", e.ToString() + "" + e.Exception.ToString() + " ");
}
static void LogUnhandledException(object exceptionobj)
static void LogUnhandledException(string type, string exceptionobj)
{
//这里可以进一步地写日志
LOGGER.Error(exceptionobj.ToString());
LogUtil.error("【" + type + "】" + exceptionobj);
MessageBox.Show(exceptionobj, type);
LogUtil.error("【" + type + "】" + exceptionobj);
}
}
}
......@@ -1715,9 +1715,9 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("收到服务器命令:op=" + resultOperation.op + ",未找到对应处理");
}
TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 10)
if (span.TotalMilliseconds > 100)
{
LogUtil.info(StoreName + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
LogUtil.info(StoreName + "执行 SendLineStatus 共 【" + span.TotalMilliseconds + "】毫秒");
}
}
private void ProcessHumidityCMD(Operation resultOperation)
......@@ -1833,9 +1833,9 @@ namespace OnlineStore.DeviceLibrary
}
TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 10)
if (span.TotalMilliseconds > 100)
{
LogUtil.info(StoreName + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
LogUtil.info(StoreName + "执行 ReviceOutStoreProcess 共 【" + span.TotalMilliseconds + "】毫秒");
}
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!