Skip to content

Recommend to use logger instead of built-in print function in distributed_strategy.py #46622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leo0519 opened this issue Sep 29, 2022 · 10 comments
Assignees
Labels

Comments

@leo0519
Copy link
Collaborator

leo0519 commented Sep 29, 2022

需求描述 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.

@paddle-bot
Copy link

paddle-bot bot commented Sep 29, 2022

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

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 APIFAQGithub Issue and AI community to get the answer.Have a nice day!

@Caozhou1995
Copy link
Contributor

thx for your suggestion and we will communicate with relevant RD for this request

@OccupyMars2025
Copy link
Contributor

I will try to solve it before 2022/10/4 9:00

@leo0519
Copy link
Collaborator Author

leo0519 commented Sep 30, 2022

@OccupyMars2025 Thank you for your help!

@OccupyMars2025
Copy link
Contributor

OccupyMars2025 commented Oct 3, 2022

@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

@paddle-bot paddle-bot bot added status/following-up 跟进中 and removed status/new-issue 新建 labels Oct 9, 2022
@OccupyMars2025
Copy link
Contributor

@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

@leo0519
Copy link
Collaborator Author

leo0519 commented Nov 4, 2022

@OccupyMars2025 Do you know who will follow up this issue? Thanks.

@OccupyMars2025
Copy link
Contributor

@leo0519 I don't know. I'm just a community developer.

@onecatcn
Copy link
Contributor

onecatcn commented Nov 7, 2022

@Caozhou1995, Please check the issue and see what you can do.

@sljlp
Copy link
Contributor

sljlp commented Nov 8, 2022

This PR #47761 may resolve the issue. @leo0519

@leo0519 leo0519 closed this as completed Nov 10, 2022
@paddle-bot paddle-bot bot added status/close 已关闭 and removed status/following-up 跟进中 labels Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants