diff --git a/docs/G-Codes.md b/docs/G-Codes.md index 4ef4c0a2c..cd4c81f4c 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: