From b3e0cb4bd80151deafb9c23ccbf43600bdb374ba Mon Sep 17 00:00:00 2001 From: Rogerio Goncalves Date: Fri, 20 Dec 2024 11:50:16 -0300 Subject: [PATCH] gcode: adds LOG_ROLLOVER gcode command to trigger a log rollover --- docs/G-Codes.md | 3 +++ klippy/gcode.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/docs/G-Codes.md b/docs/G-Codes.md index b18e0186e..b21837908 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -717,6 +717,9 @@ clears any error state from the micro-controller. #### HEATER_INTERRUPT `HEATER_INTERRUPT`: Interrupts a TEMPERATURE_WAIT command. +#### LOG_ROLLOVER +`LOG_ROLLOVER`: Trigger a klippy.log rollover and generate a new log file. + #### STATUS `STATUS`: Report the Kalico host software status. diff --git a/klippy/gcode.py b/klippy/gcode.py index f6c84f213..b6bea773e 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -168,6 +168,7 @@ def __init__(self, printer): "STATUS", "HELP", "HEATER_INTERRUPT", + "LOG_ROLLOVER", ] for cmd in handlers: func = getattr(self, "cmd_" + cmd) @@ -496,6 +497,9 @@ def cmd_HELP(self, gcmd): def cmd_HEATER_INTERRUPT(self, gcmd): self.increment_interrupt_counter() + def cmd_LOG_ROLLOVER(self, gcmd): + self.printer.bglogger.doRollover() + # Support reading gcode from a pseudo-tty interface class GCodeIO: