Change View, Modal, and AudioPlayer to use logger instead of stderr

This commit is contained in:
mniip
2022-06-22 09:10:02 +03:00
committed by GitHub
parent 9fc4769b18
commit 1be36c9c3e
5 changed files with 11 additions and 17 deletions

View File

@ -24,7 +24,6 @@ DEALINGS IN THE SOFTWARE.
from __future__ import annotations
import threading
import traceback
import subprocess
import audioop
import asyncio
@ -709,14 +708,10 @@ class AudioPlayer(threading.Thread):
try:
self.after(error)
except Exception as exc:
_log.exception('Calling the after function failed.')
exc.__context__ = error
traceback.print_exception(type(exc), exc, exc.__traceback__)
_log.exception('Calling the after function failed.', exc_info=exc)
elif error:
msg = f'Exception in voice thread {self.name}'
_log.exception(msg, exc_info=error)
print(msg, file=sys.stderr)
traceback.print_exception(type(error), error, error.__traceback__)
_log.exception('Exception in voice thread %s', self.name, exc_info=error)
def stop(self) -> None:
self._end.set()