chore: replace print with logging and make robot conditional

All print statements in the main program, and components used by the main program, have been replaced with appropriate logging statements. The connection to the robot now only gets made when it's possible, otherwise only the microphone will be run.

ref: N25B-119
This commit is contained in:
Twirre Meulenbelt
2025-10-02 16:13:39 +02:00
parent 2132a74321
commit c634e4b516
3 changed files with 40 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
import logging
import signal
import threading
@@ -16,12 +17,12 @@ class State(object):
def initialize(self):
if self.is_initialized:
print("Already initialized")
logging.warn("Already initialized")
return
self.exit_event = threading.Event()
def handle_exit(_, __):
print("Exiting.")
logging.info("Exiting.")
self.exit_event.set()
signal.signal(signal.SIGINT, handle_exit)
signal.signal(signal.SIGTERM, handle_exit)