Commit 8b6ab209 authored by Guillaume Seguin's avatar Guillaume Seguin

More improvements to printcore logging

parent 8fb1bb0b
...@@ -165,11 +165,11 @@ class printcore(): ...@@ -165,11 +165,11 @@ class printcore():
self.printer_tcp.settimeout(self.timeout) self.printer_tcp.settimeout(self.timeout)
self.printer = self.printer_tcp.makefile() self.printer = self.printer_tcp.makefile()
except socket.error as e: except socket.error as e:
logging.error(_("Could not connect to %s:%s:") % (hostname, port)) logging.error(_("Could not connect to %s:%s:") % (hostname, port) +
"\n" + _("Socket error %s:") % e.errno +
"\n" + e.strerror)
self.printer = None self.printer = None
self.printer_tcp = None self.printer_tcp = None
logging.error(_("Socket error %s:") % e.errno,)
logging.error(e.strerror)
return return
else: else:
disable_hup(self.port) disable_hup(self.port)
...@@ -179,9 +179,9 @@ class printcore(): ...@@ -179,9 +179,9 @@ class printcore():
baudrate = self.baud, baudrate = self.baud,
timeout = 0.25) timeout = 0.25)
except SerialException as e: except SerialException as e:
logging.error(_("Could not connect to %s at baudrate %s:") % (self.port, self.baud)) logging.error(_("Could not connect to %s at baudrate %s:") % (self.port, self.baud) +
"\n" + _("Serial error: %s") % e)
self.printer = None self.printer = None
logging.error(_("Serial error: %s") % e)
return return
self.stop_read_thread = False self.stop_read_thread = False
self.read_thread = Thread(target = self._listen) self.read_thread = Thread(target = self._listen)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment