From 12ca45a2647a56801bcd6f14f79d6733058b15ca Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 17 Jul 2017 11:24:15 -0400 Subject: [PATCH] gcode: Log g-code error responses Be sure to log g-code errors even if debug logging is not enabled. Signed-off-by: Kevin O'Connor --- klippy/gcode.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/klippy/gcode.py b/klippy/gcode.py index 4b1717b8..fdd76f73 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -152,14 +152,15 @@ class GCodeParser: os.write(self.fd, "ok\n") self.need_ack = False def respond(self, msg): - logging.debug(msg) if self.is_fileinput: return os.write(self.fd, msg+"\n") def respond_info(self, msg): + logging.debug(msg) lines = [l.strip() for l in msg.strip().split('\n')] self.respond("// " + "\n// ".join(lines)) def respond_error(self, msg): + logging.warning(msg) lines = msg.strip().split('\n') if len(lines) > 1: self.respond_info("\n".join(lines[:-1])) @@ -250,7 +251,7 @@ class GCodeParser: # Tn command has to be handled specially self.cmd_Tn(params) return - self.respond('echo:Unknown command:"%s"' % (cmd,)) + self.respond_info('Unknown command:"%s"' % (cmd,)) def cmd_Tn(self, params): # Select Tool index = self.get_int('T', params)