From 49f727477eb62c57d9978e5187f1d18f96cc9cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Sun, 28 Jul 2024 08:09:34 +0000 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA=EF=BC=8C=E6=96=B9=E4=BE=BF=E6=8E=92=E6=9F=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/cli.py | 7 ++++++- xiaomusic/xiaomusic.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xiaomusic/cli.py b/xiaomusic/cli.py index 85c95d6..b93217c 100644 --- a/xiaomusic/cli.py +++ b/xiaomusic/cli.py @@ -84,7 +84,7 @@ def main(): "format": f"%(asctime)s [{__version__}] [%(levelname)s] %(filename)s:%(lineno)d: %(message)s", "datefmt": "[%X]", } - LOGGING_CONFIG["handlers"]["access"] = { + LOGGING_CONFIG["handlers"]["access_file"] = { "level": "INFO", "class": "logging.handlers.RotatingFileHandler", "formatter": "access", @@ -92,6 +92,11 @@ def main(): "maxBytes": 10 * 1024 * 1024, "backupCount": 1, } + LOGGING_CONFIG["handlers"]["access_console"] = { + "level": "INFO", + "class": "logging.StreamHandler", + "formatter": "access", + } uvicorn.run( HttpApp, host=["::", "0.0.0.0"], diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index e2287f3..92e8de4 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -1142,6 +1142,7 @@ class XiaoMusicDevice: async def _do_next(): await asyncio.sleep(self._timeout) try: + self.log.info("定时器时间到了") await self.play_next() except Exception as e: self.log.error(f"Execption {e}")