Skip to content
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

Use mlc logger in scripts instead of print statements #165

Open
arjunsuresh opened this issue Jan 28, 2025 · 2 comments
Open

Use mlc logger in scripts instead of print statements #165

arjunsuresh opened this issue Jan 28, 2025 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@arjunsuresh
Copy link
Collaborator

We now have a global logger from MLC being used in Script automation. We need to modify the individual scripts also to use this logger instead of print statements.

@arjunsuresh arjunsuresh added the enhancement New feature or request label Jan 28, 2025
@arjunsuresh arjunsuresh added the good first issue Good for newcomers label Jan 28, 2025
sujik18 added a commit to sujik18/mlperf-automations that referenced this issue Feb 2, 2025
@sujik18
Copy link
Member

sujik18 commented Feb 2, 2025

@arjunsuresh, do we need to similarly modify all the scripts present inside the script folder individually to replace the print statements with the usage of logger?

@arjunsuresh
Copy link
Collaborator Author

@sujik18 That's correct but a small change is needed. If we initialise logging in each file, they'll log independently which is not desirable. We do have an option to get the global logger in customize.py by doing the following

logger = i['automation'].logger

and then we can do

logger.warning('CM warning: {}'.format(e))

which uses the global logger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

2 participants