Conversation
|
hey @wblachowski , thanks for the PR! I think that's a good idea. Maybe another suggestion from me, we can set the EDIT: oh wait, I think setting the |
|
Hi, Yet another solution would be to pass a flag like class VideoIndexer():
def __init__(self, log_level):
self.log_level= log_level
def print_info(self, msg):
# Prints for INFO and DEBUG
if self.log_level != LogLevel.NONE:
print(msg)
def print_debug(self, msg):
# Prints for DEBUG only (too specific for INFO)
if self.log_level == LogLevel.DEBUG:
print(msg)
def upload_to_video_indexer(self):
print_info('Uploading video to video indexer...')
....
def get_video_info(self):
print_debug('Getting video info for ....')
....It's somewhere in the middle between the two previous solutions. What do you think? |
Hi, first of all - a great utility library, it's been a great time saver.
I'd like to suggest a small change that would allow the user to silent all prints as I found it a tad annoying to have the library spam my standard output with numerous messages, especially when polling for processing results.
I wondered whether some kind of a "global" silencing (passing a
silentoption once, in theVideoIndexerconstructor), or a more seamless solution (such as overwritingsys.stdout) would be better, but in the end, I settled for the simplest solution, which is the ability to pass asilentarg to each method capable of printing something.