Recommend to use logger instead of built-in print function in distributed_strategy.py
需求描述 Feature Description
Logger module can help users easier to see where and when a logging is being made from, but distributed_strategy.py still uses built-in function print to show the warning message. For instance,
test_logger.py
from paddle.fluid.log_helper import get_logger
print('[Warning] Print warning message')
logger = get_logger(__name__, logging.INFO,
fmt='%(asctime)s :: %(levelname)s :: Module %(module)s :: Line No %(lineno)s :: %(message)s'
)
logger.warning('Logger warning message')
result
python3 test_logger.py
[Warning] Print warning message
1203: Thu Sep 29 01:36:10 :: WARNING :: Module test_logger :: Line No 7 :: Logger warning message
The logger module is better for users to know the time, severity, and the python module where the message from.
替代实现 Alternatives
Replace print with logger module in distributed_strategy.py.
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
thx for your suggestion and we will communicate with relevant RD for this request
I will try to solve it before 2022/10/4 9:00
@OccupyMars2025 Thank you for your help!
@leo0519 I'm sorry that I fail to accomplish my promise. After promising to solve this issue, I determined to participate in a Baidu competition. So I'm afraid that I won't have free time to solve this issue before 2022/10/16. If this issue is still not solved on 2022/10/16, then I will try to solve it myself. I promise to solve this issue before 2022/10/20 9:00
@leo0519 I'm very sorry that I decide to give up solving this issue because of my personal reasons. I'm a developer from the PaddlePaddle community. There should be another developer to follow up this issue. You can keep an eye on the progress. 2022/10/15 11:00
@OccupyMars2025 Do you know who will follow up this issue? Thanks.
@leo0519 I don't know. I'm just a community developer.
@Caozhou1995, Please check the issue and see what you can do.
This PR #47761 may resolve the issue. @leo0519