liyuheng55555 commented on code in PR #16072:
URL: https://github.com/apache/iotdb/pull/16072#discussion_r2245766463


##########
iotdb-core/ainode/ainode/core/log.py:
##########
@@ -16,55 +16,12 @@
 # under the License.
 #
 
-import inspect
-import logging
-import multiprocessing
-import os
-import random
-import sys
-import threading
-
-from ainode.core.constant import (
-    AINODE_LOG_DIR,
-    AINODE_LOG_FILE_LEVELS,
-    AINODE_LOG_FILE_NAMES,
-    STD_LEVEL,
-)
+from ainode.core.logger.base_logger import BaseLogger
 from ainode.core.util.decorator import singleton
 
 
-class LoggerFilter(logging.Filter):
-    def filter(self, record):
-        record.msg = f"{self.custom_log_info()}: {record.msg}"
-        return True
-
-    @staticmethod
-    def custom_log_info():
-        frame = inspect.currentframe()
-        stack_trace = inspect.getouterframes(frame)
-
-        pid = os.getpid()
-        process_name = multiprocessing.current_process().name
-
-        stack_info = ""
-        frame_info = stack_trace[7]
-        file_name = frame_info.filename
-        # if file_name is not in current working directory, find the first 
"iotdb" in the path
-        for l in range(len(file_name)):
-            i = len(file_name) - l - 1
-            if file_name[i:].startswith("iotdb/") or file_name[i:].startswith(
-                "iotdb\\"
-            ):
-                file_name = file_name[i:]
-                break
-
-        stack_info += f"{file_name}:{frame_info.lineno}-{frame_info.function}"
-
-        return f"[{pid}:{process_name}] {stack_info}"
-
-
 @singleton
-class Logger:
+class Logger(BaseLogger):

Review Comment:
   This class should be renamed to `GlobalLogger` in next pr



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to