Add --log-format

This commit is contained in:
Michael Hansen
2024-01-19 16:58:41 -06:00
parent d1578cb863
commit 87bfcf4bf7
+6 -1
View File
@@ -235,6 +235,9 @@ async def main() -> None:
"--debug-recording-dir", help="Directory to store audio for debugging" "--debug-recording-dir", help="Directory to store audio for debugging"
) )
parser.add_argument("--debug", action="store_true", help="Log DEBUG messages") parser.add_argument("--debug", action="store_true", help="Log DEBUG messages")
parser.add_argument(
"--log-format", default=logging.BASIC_FORMAT, help="Format for log messages"
)
args = parser.parse_args() args = parser.parse_args()
# Validate args # Validate args
@@ -267,7 +270,9 @@ async def main() -> None:
if args.vad and (args.wake_uri or args.wake_command): if args.vad and (args.wake_uri or args.wake_command):
_LOGGER.warning("VAD is not used with local wake word detection") _LOGGER.warning("VAD is not used with local wake word detection")
logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO) logging.basicConfig(
level=logging.DEBUG if args.debug else logging.INFO, format=args.log_format
)
_LOGGER.debug(args) _LOGGER.debug(args)
if args.debug_recording_dir: if args.debug_recording_dir: