diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-02-11 22:57:05 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-02-11 22:58:00 +0100 |
commit | 4e50c8291bd83a3fbb24a209fd1f6c7cbdb5283c (patch) | |
tree | 78dc08a0979287c22e9dd3099e839c4540f8e975 | |
parent | 833a7b602cd22c7d20604c37561c6e5a9699d582 (diff) | |
download | mpd-box-4e50c8291bd83a3fbb24a209fd1f6c7cbdb5283c.tar.gz mpd-box-4e50c8291bd83a3fbb24a209fd1f6c7cbdb5283c.tar.xz |
daemon: add some more log entries
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | daemon.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -21,6 +21,7 @@ class Daemon: def __init__(self): self.ser = serial.Serial(sys.argv[1], 9600, timeout=1) + logger.debug("connected. waiting for client greeting") # raise timeout to let arduino start up self.ser.timeout = 15 @@ -29,13 +30,14 @@ class Daemon: # arduino sometimes has a dirty buffer # and sends junk before the ready message if not incoming.endswith("ready"): - sys.stderr.write("Got unexpected reply: "+incoming) - raise Exception("Wrong client greeting") + log.error("Got reply: '"+incoming+"'") + raise Exception("Wrong or no client greeting") self.ser.timeout = 1 + logger.debug("got client greeting") self.client = mpd.MPDClient() self.client.connect("localhost", 6600) - logger.debug("connected") + logger.debug("connected to mpd") def readline(self): return self.ser.readline().decode("ascii").strip() |