From 9d655c667cb40ba64e3f6fe5400c9e8c139e9988 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期三, 23 八月 2023 14:51:55 +0800
Subject: [PATCH] 添加异步日志

---
 l2/l2_log.py |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/l2/l2_log.py b/l2/l2_log.py
index 1d34bbe..1a669a9 100644
--- a/l2/l2_log.py
+++ b/l2/l2_log.py
@@ -1,23 +1,26 @@
+from log_module import async_log_util
 from log_module.log import logger_l2_trade_cancel, logger_l2_trade_buy, logger_trade_record, logger_l2_trade
 
 threadIds = {}
 
 
 def debug(code, content, *args):
-    logger_l2_trade.debug(("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
+    async_log_util.debug(logger_l2_trade,
+                         ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
 
 
 def buy_debug(code, content, *args):
-    logger_l2_trade_buy.debug(
-        ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
+    async_log_util.debug(logger_l2_trade_buy,
+                         ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
 
 
 def cancel_debug(code, content, *args):
-    logger_l2_trade_cancel.debug(
-        ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
+    async_log_util.debug(logger_l2_trade_cancel,
+                         ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
 
 
 # 浜ゆ槗璁板綍
 def trade_record(code, type, content, *args):
-    logger_trade_record.debug(
-        ("thread-id={} code={} type={} data=".format(threadIds.get(code), code, type) + content).format(*args))
+    async_log_util.debug(logger_trade_record,
+                         ("thread-id={} code={} type={} data=".format(threadIds.get(code), code,
+                                                                      type) + content).format(*args))

--
Gitblit v1.8.0