Migrate print() to the Logger?
#431
Replies: 3 comments 2 replies
-
|
Hi Nick, we actually also do logging to a log file (under ~/.pixeltable/logs). But you make a good point, we should probably allow the user to configure whether the status messages go to the console and/or the log. Let me bring this up with the team early next week, and we'll get back to you shortly. Thanks for making the suggestion! |
Beta Was this translation helpful? Give feedback.
-
|
Hi Nick, quick update: we're going to add a 'verbosity' config option that you'll be able to set to 0 to disable console output. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Nick, you can now configure the volume of console output. See 'verbosity' in the config: Let us know if that takes care of the problem for you. Marcel |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m not sure if this was a deliberate design choice, but I noticed that pixeltable has a configured logger while still relying on many direct
print()calls. These print calls primarily confirm database operations and are helpful if you’re getting started or running a few individual commands by hand. However, they can flood the console when you run thousands of operations. In my case, I’ve even had a Jupyter notebook become essentially unresponsive after thousands ofprint()statements.Ideally, I’d still like to use
print()in my scripts for quick debugging, but have the pixeltable outputs redirected to a log file for later review—without resorting to complicated Python stdout redirection.Question:
Is there an easy way to achieve this with the current setup? If so, please let me know. If not, I propose the following change:
print()).configure_logging()option (or similar) to route all output through the logger.This way, users can choose between seeing output directly in the console or sending it to a log file. Let me know your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions