You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "liyuheng55555 (via GitHub)" <gi...@apache.org> on 2025/07/31 15:43:55 UTC
[PR] [ainode] Logger optimize [iotdb]
liyuheng55555 opened a new pull request, #16072:
URL: https://github.com/apache/iotdb/pull/16072
The newly added `BaseLogger` lets you specify the path where log files are saved.
Previous log files will continue to be written under the `log_ainode_all` directory.
For example, for InferenceRequestPool, if you set the path to log_inference_rank_x, the resulting is:
```
logs
├── log_ainode_all
│ ├── log_ainode_all.log
│ ├── log_ainode_error.log
│ ├── log_ainode_info.log
│ └── log_ainode_warning.log
└── log_inference_rank_x
├── log_ainode_all.log
├── log_ainode_error.log
├── log_ainode_info.log
└── log_ainode_warning.log
```
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AINode] Logger format optimize [iotdb]
Posted by "CRZbulabula (via GitHub)" <gi...@apache.org>.
CRZbulabula merged PR #16072:
URL: https://github.com/apache/iotdb/pull/16072
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AINode] Logger format optimize [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16072:
URL: https://github.com/apache/iotdb/pull/16072#issuecomment-3144339732
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AINode] Logger format optimize [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16072:
URL: https://github.com/apache/iotdb/pull/16072#issuecomment-3144252176
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AINode] Logger format optimize [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16072:
URL: https://github.com/apache/iotdb/pull/16072#issuecomment-3144360700
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [AINode] Logger format optimize [iotdb]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #16072:
URL: https://github.com/apache/iotdb/pull/16072#issuecomment-3144218524
## [](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_iotdb&pullRequest=16072&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_iotdb&pullRequest=16072&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_iotdb&pullRequest=16072&metric=new_duplicated_lines_density&view=list)
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=16072)
--
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [ainode] Logger optimize [iotdb]
Posted by "liyuheng55555 (via GitHub)" <gi...@apache.org>.
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: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org