style: 优化日志输出,方便排查问题
This commit is contained in:
parent
43886116c1
commit
49f727477e
@ -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"],
|
||||
|
@ -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}")
|
||||
|
Loading…
Reference in New Issue
Block a user