bb.utils.init_logger(bb.msg, configuration.verbose, configuration.debug,
configuration.debug_domains)
+ # Ensure logging messages get sent to the UI as events
+ handler = bb.event.LogHandler()
+ logger.addHandler(handler)
+
# Clear away any spurious environment variables. But don't wipe the
# environment totally. This is necessary to ensure the correct operation
# of the UIs (e.g. for DISPLAY, etc.)
server = ProcessServer(server_channel, event_queue, configuration)
server.start()
+ logger.removeHandler(handler)
+
def shutdown(force=False):
signal.signal(signal.SIGINT, signal.SIG_IGN)
server.stop()
def main(self):
"""Server main loop"""
- # Ensure logging messages get sent to the UI as events
- logger.addHandler(bb.event.LogHandler())
-
# Ignore SIGINT within the server, as all SIGINT handling is done by
# the UI and communicated to us
signal.signal(signal.SIGINT, signal.SIG_IGN)