From a7a394e1525cfb85aff1ba02f0961dbb07748bc8 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 10 二月 2023 19:06:09 +0800
Subject: [PATCH] 日志优化,部分大单并行化处理

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

diff --git a/l2/l2_log.py b/l2/l2_log.py
index c2e4174..48df92e 100644
--- a/l2/l2_log.py
+++ b/l2/l2_log.py
@@ -1,15 +1,17 @@
 from log import logger_l2_trade_cancel, logger_l2_trade_buy, logger_l2_trade
 
-
-def debug(random_key, code, content, *args):
-    logger_l2_trade.debug(("thread-id={} code={}  ".format(random_key, code) + content).format(*args))
+threadIds = {}
 
 
-def buy_debug(random_key, code, content, *args):
+def debug( code, content, *args):
+    logger_l2_trade.debug(("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(random_key, code) + content).format(*args))
+        ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))
 
 
-def cancel_debug(random_key, code, content, *args):
+def cancel_debug(code, content, *args):
     logger_l2_trade_cancel.debug(
-        ("thread-id={} code={}  ".format(random_key, code) + content).format(*args))
+        ("thread-id={} code={}  ".format(threadIds.get(code), code) + content).format(*args))

--
Gitblit v1.8.0