-
Notifications
You must be signed in to change notification settings - Fork 45
Changed logger to Loguru #2025
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
Changed logger to Loguru #2025
Conversation
…colorize them. Also added an easier way to change logs to DEBUG INFO WARNING etc from the .env file, and made it possible to generate JSON logs with Loguru
…ation easier (one place to configure instead of every file where it's called
|
That is a very good change, thank you. I think this is a related issue: Let's see if it's a change we want too. |
|
I will look at Loguru's options to see if it can make some arguments more readable |
Nice. Otherwise, we can also take inspiration from this fork where this was done: https://github.com/utkutvskin/codabench/pull/1/files |
A brief description of the purpose of the changes contained in this PR.
Changed default logger to Loguru
Made Loguru intercept all logs and colorize them.
Also added an easier way to change logs to DEBUG INFO WARNING etc from the .env file, and made it possible to generate JSON logs with Loguru
The Gunicorn/Uvicorn interception was based on this guide, which I adapted a bit.
I added some new options in the
.envfile, so a manual intervention is needed to update the local.envfile. The default value for those options isINFOandfalse, so if they don't exist in the.envfile, the instance won't have any problems.Some images:
Compute worker logs :
Old
New
Django
Old
New
Site worker:
Old
New
An error from the site worker, uploading a submission as a competition bundle
Old
New
And to finish, one screenshot of logs converted to JSON (from the site worker)
Checklist