Python - turn off logging
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm using Python to automatically sync our CANVAS data into our database. However, I'd prefer to not have the results of each table's syncing printed out (e.g. "No rows to upsert", "No rows to delete").
Is there a way to add a line (or so) to the code so that those logs won't be printed out?
I'm new to this Python package and coding in general.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to figure this out.
At the bottom of the docs, you can find where it talks about logging: https://data-access-platform-api.s3.amazonaws.com/client/README.html#configure-log-level-for-debuggi...
I took the code at the bottom of the page, and updated the "DEBUG" to "CRITICAL". This gives no logging unless there are issues, and only the print statements I want to print are printed out. https://docs.python.org/3/library/logging.html#levels