Skip to content

Commit 88dd541

Browse files
committed
hal_glib -quiet ZMQ import failed message
Put it behind a debug message so it doesn't bother people who don't need it.
1 parent 2a333b1 commit 88dd541

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/python/common/hal_glib.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import zmq
1919
import json
2020
except:
21-
print('Cannot import ZMQ')
2221
zmq = None
2322

2423
# constants
@@ -318,6 +317,10 @@ def __init__(self, stat = None):
318317
if zmq:
319318
self.init_write_socket()
320319
self.init_read_socket()
320+
else:
321+
# logging set up now - add ZMQ failed message
322+
LOG.debug('ZMQ python library not imported - Is python3-zmq installed?')
323+
LOG.debug('ZMQ socket messages will not be processed')
321324

322325
self._status_active = False
323326
self.old = {}
@@ -353,8 +356,8 @@ def init_write_socket(self):
353356
self.write_socket.bind(self.writeAddress)
354357
LOG.debug('hal_glib write socket available: {}'.format(self.writeAddress))
355358
self.write_available = True
356-
except:
357-
LOG.debug('hal_glib write socket not available')
359+
except Exception as e:
360+
LOG.debug('hal_glib write socket not available: {}'.format(e))
358361
self.write_available = False
359362

360363
# convert and actually send out the message

0 commit comments

Comments
 (0)