From aefde48c984c891b128904ddf40a311ed4c0f41d Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Thu, 29 Sep 2022 10:01:18 +0100 Subject: [PATCH] loglevel INFO set for examples --- examples/dsl/__main__.py | 5 ++++- examples/midi/__main__.py | 5 ++++- examples/obs/__main__.py | 7 ++++++- examples/observer/__main__.py | 5 ++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/examples/dsl/__main__.py b/examples/dsl/__main__.py index 5f400e9..ab077f4 100644 --- a/examples/dsl/__main__.py +++ b/examples/dsl/__main__.py @@ -1,3 +1,4 @@ +import logging import time import voicemeeterlib @@ -55,8 +56,9 @@ class Parser: def main(cmds=None): kind_id = "banana" + subs = {ev: False for ev in ["pdirty", "mdirty", "ldirty", "midi"]} - with voicemeeterlib.api(kind_id) as vm: + with voicemeeterlib.api(kind_id, subs=subs) as vm: parser = Parser(vm) if cmds: res = parser.parse(cmds) @@ -72,6 +74,7 @@ def main(cmds=None): if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) cmds = ( "strip 0 -> mute -> on", "strip 0 -> mute", diff --git a/examples/midi/__main__.py b/examples/midi/__main__.py index 05bfd5f..8bcaec8 100644 --- a/examples/midi/__main__.py +++ b/examples/midi/__main__.py @@ -1,3 +1,5 @@ +import logging + import voicemeeterlib @@ -45,7 +47,7 @@ class Observer: def main(): # we only care about midi events here. - subs = {ev: False for ev in ["pdirty", "mdirty", "ldirty"]} + subs = {ev: False for ev in ["pdirty", "mdirty"]} with voicemeeterlib.api(kind_id, subs=subs) as vm: obs = Observer(vm, midi_btn, macrobutton) obs.register() @@ -56,6 +58,7 @@ def main(): if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) kind_id = "banana" # leftmost M on korg nanokontrol2 in CC mode midi_btn = 48 diff --git a/examples/obs/__main__.py b/examples/obs/__main__.py index 737528b..9782769 100644 --- a/examples/obs/__main__.py +++ b/examples/obs/__main__.py @@ -1,3 +1,5 @@ +import logging + import obsws_python as obs import voicemeeterlib @@ -49,7 +51,10 @@ def on_current_program_scene_changed(data): if __name__ == "__main__": - with voicemeeterlib.api("potato") as vm: + logging.basicConfig(level=logging.INFO) + + subs = {ev: False for ev in ["pdirty", "mdirty", "midi"]} + with voicemeeterlib.api("potato", subs=subs) as vm: cl = obs.EventClient() cl.callback.register(on_current_program_scene_changed) diff --git a/examples/observer/__main__.py b/examples/observer/__main__.py index 2ff347b..b9cb8ce 100644 --- a/examples/observer/__main__.py +++ b/examples/observer/__main__.py @@ -1,3 +1,5 @@ +import logging + import voicemeeterlib @@ -31,7 +33,7 @@ class Observer: def main(): with voicemeeterlib.api(kind_id) as vm: - obs = Observer(vm) + Observer(vm) while cmd := input("Press to exit\n"): if not cmd: @@ -39,6 +41,7 @@ def main(): if __name__ == "__main__": + logging.basicConfig(level=logging.INFO) kind_id = "banana" main()