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

Replacing all the print calls by calls to log #272

Conversation

amrutharajashekar
Copy link

@amrutharajashekar amrutharajashekar commented Oct 29, 2022

#267 replacing all the print calls by calls to log

@C4ptainCrunch
Copy link
Contributor

Hello again !

The tests are failing because of Black and isort are failing.
Could you install pre-commit (pip install pre-commit) and then run it locally ? (pre-commit run --all) so that it reformats your files and then commit the changes ?
Sorry about those convoluted steps, we should have documented them in the README.

Once that is done, the tests will be able to run and we can review your PR :)

@C4ptainCrunch C4ptainCrunch changed the title #267 replacing all the print calls by calls to log Replacing all the print calls by calls to log Oct 31, 2022
@amrutharajashekar
Copy link
Author

amrutharajashekar commented Oct 31, 2022

Hi @C4ptainCrunch , I have pushed the changes from pre-commit present in MR #272 .
Please let me know if any other changes are required.
Thanks!

Copy link
Contributor

@C4ptainCrunch C4ptainCrunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I did checkout your PR and tried running ./manage.py runserver but it does not show the warning (you are running Dochub with DEBUG=True) that comes from https://github.com/UrLab/DocHub/pull/272/files#diff-a319b4e09ca929987f4eadd50f04ac0d0afeebd4ade69e396ffd43fd557baa47L213 but when checkouting main, it does. So it seems your change from print to logging.debug breaks the output. I'm guessing it's due to the logging configuration but i'm not sure.

Could you try to fix this and ensure that the print your replaced still output text in the terminal ? Thank you !

@amrutharajashekar
Copy link
Author

Hi @C4ptainCrunch , I have made few changes for logging the statements .

Now all debug logs are shown in stdout / terminal.
I have created a file www/logger_settings.py in which we can specify the log level we want to show in stdout.

Please review and let me know if any other changes are required .
Thank you.

@Mortinat
Copy link
Contributor

@amrutha1098 I suggest you to read the django documentation https://docs.djangoproject.com/en/4.1/topics/logging/. There is already a logging system existing in django

@C4ptainCrunch
Copy link
Contributor

Hi @amrutha1098 !
Did you have some time to look at the logging system of Django like suggested by @Mortinat ? Are you still interested in working on this PR ?

@amrutharajashekar
Copy link
Author

Hi @C4ptainCrunch , currently held up in other work so i am not able to work on this.

@C4ptainCrunch
Copy link
Contributor

Thank you for letting us know :) I'm closing the PR to clean up a bit the repo, but if you still have time later, feel free to reopen !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider replacing all the print calls by calls to log
3 participants