Python - turn off logging

Jump to solution
BryanJohnson314
Community Member

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!

Labels (4)
0 Likes
1 Solution
BryanJohnson314
Community Member
Author

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

View solution in original post

0 Likes