From bf70b06e72663aae219224560c7878018facd87e Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Tue, 1 Sep 2020 23:16:09 -0400 Subject: [PATCH] Add debug configuration setting --- turntable.sample.json | 1 + turntable/cli.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/turntable.sample.json b/turntable.sample.json index 6a5b7d7..9219909 100644 --- a/turntable.sample.json +++ b/turntable.sample.json @@ -1,4 +1,5 @@ { + "debug": false, "audio": { "device": "hw:1,0", "framerate": 48000, diff --git a/turntable/cli.py b/turntable/cli.py index 52bf19c..25bbd98 100644 --- a/turntable/cli.py +++ b/turntable/cli.py @@ -23,7 +23,6 @@ VERSION = importlib.metadata.version("turntable") def main() -> None: - logging.basicConfig(level=logging.INFO) print(f"Turntable {VERSION}") parser = argparse.ArgumentParser() @@ -34,6 +33,8 @@ def main() -> None: with open(args.config, "r") as config_file: config: Dict[str, Any] = json.load(config_file) + logging.basicConfig(level=logging.DEBUG if config.get("debug") else logging.INFO) + pcm_in: "Queue[PCM]" = Queue() events: "Queue[Event]" = Queue()