From fd0cd351521aa25c6d6d5a6b4f7073929556cfd4 Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 6 Sep 2019 14:05:47 -0400 Subject: [PATCH] Enable logging of nio errors --- src/python/app.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/python/app.py b/src/python/app.py index 052e076b..e1ec040e 100644 --- a/src/python/app.py +++ b/src/python/app.py @@ -1,6 +1,7 @@ import asyncio import logging as log import signal +import sys from concurrent.futures import Future from operator import attrgetter from threading import Thread @@ -8,10 +9,14 @@ from typing import Coroutine, Sequence from appdirs import AppDirs +import nio + from . import __about__, pyotherside from .pyotherside_events import CoroutineDone log.getLogger().setLevel(log.INFO) +nio.logger_group.level = nio.log.logbook.ERROR +nio.log.logbook.StreamHandler(sys.stderr).push_application() try: import uvloop @@ -47,6 +52,7 @@ class App: def set_debug(self, enable: bool, verbose: bool = False) -> None: if verbose: log.getLogger().setLevel(log.DEBUG) + nio.logger_group.level = nio.log.logbook.DEBUGG if enable: log.info("Debug mode enabled.")