Skip to content

Commit

Permalink
gcode: adds LOG_ROLLOVER gcode command to trigger a log rollover
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerlz committed Dec 20, 2024
1 parent 5c42ff9 commit b3e0cb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/G-Codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 4 additions & 0 deletions klippy/gcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def __init__(self, printer):
"STATUS",
"HELP",
"HEATER_INTERRUPT",
"LOG_ROLLOVER",
]
for cmd in handlers:
func = getattr(self, "cmd_" + cmd)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b3e0cb4

Please sign in to comment.