From 72f3802bd7ab24b672c951a287787b5dea253f3b Mon Sep 17 00:00:00 2001
From: mrDarker <mr.darker@163.com>
Date: 星期六, 02 八月 2025 10:48:36 +0800
Subject: [PATCH] Merge branch 'clh' into liuyang

---
 SourceCode/Bond/SGMeasurement/Logger.h |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/SGMeasurement/Logger.h b/SourceCode/Bond/SGMeasurement/Logger.h
new file mode 100644
index 0000000..aec95af
--- /dev/null
+++ b/SourceCode/Bond/SGMeasurement/Logger.h
@@ -0,0 +1,28 @@
+#pragma once
+#include <afx.h>
+
+class CLogger
+{
+public:
+    static CLogger& Instance();  // 获取单例
+    void WriteLine(CString str); // 写一行日志
+    void CloseLogFile();         // 关闭日志文件
+
+private:
+    CLogger();
+    ~CLogger();
+    void OpenLogFile();          // 内部打开文件
+
+    CCriticalSection m_csLogLock;
+    CString m_strCurrentLogPath;
+    CStdioFile m_logFile;
+};
+
+#define LOG_LINE(x) CLogger::Instance().WriteLine(x)
+
+#define LOG_LINEF(fmt, ...)                     \
+    do {                                        \
+        CString __log__;                        \
+        __log__.Format(fmt, __VA_ARGS__);       \
+        CLogger::Instance().WriteLine(__log__); \
+    } while (0)
\ No newline at end of file

--
Gitblit v1.9.3