Updated logging calls

This commit is contained in:
Erik Thuning 2023-11-30 09:53:09 +01:00
parent 6da6e92d46
commit b5eda4695f
4 changed files with 10 additions and 5 deletions

@ -26,6 +26,8 @@ cachedir = /a/fifth
## What log messages are shown on stderr.
## Defaults to ERROR if omitted.
## For the spammiest logging, use the number 5 here.
## Beware that this can log multiple gigabytes per hour.
log_level = DEBUG
## Mail settings for emailing log messages.

@ -82,6 +82,7 @@ class SubtitlesHandler(Handler):
self.whispermodel = config['whispermodel']
self.modeldir = config['modeldir']
self.device = device
self.logger.debug(f'Created SubtitlesHandler on {device}')
@classmethod
def instantiate(cls,
@ -260,14 +261,14 @@ class SubtitlesHandler(Handler):
transcribes.append(transcribe)
resultfiles[trackname] = outpath
self.logger.debug("Waiting for transcribes")
self.logger.info("Waiting for transcribes")
# Wait for transcribes to finish
try:
for item in transcribes:
item.wait()
except Exception as e:
self.logger.error(e, exc_info=e)
self.logger.debug("Done, making apply_func")
self.logger.info("Done, making apply_func")
def apply_func(package):
for name, subsfile in jobspec.get('subtitles', {}).items():

@ -205,10 +205,10 @@ class TranscodeHandler(Handler):
transcodes.append(transcode)
resultfiles[sourcename][maxheight] = outfile
self.logger.debug("Waiting for transcodes")
self.logger.info("Waiting for transcodes")
for item in transcodes:
item.get()
self.logger.debug("Done, making apply_func")
self.logger.info("Done, making apply_func")
def apply_func(package):
sources = package['sources']

@ -22,7 +22,9 @@ class QueueThread(Thread, metaclass=ABCMeta):
try:
item = self.queue.get_nowait()
try:
self.logger.debug('Processing %s', item)
# This can be incredibly spammy, so using an even more
# verbose level than debug.
self.logger.log(5, 'Processing %s', item)
self._process(item)
except Exception as e:
self.logger.error(