webhooks: Add client_info parameter to "info" webhook

Allow clients to send their version info to klipper and arrange for
that info to be logged.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-08-25 14:49:43 -04:00
parent 2bb6b0f58f
commit b6a25393d3
2 changed files with 32 additions and 14 deletions

View file

@ -39,6 +39,9 @@ class QueueListener(logging.handlers.TimedRotatingFileHandler):
self.bg_queue.put_nowait(None)
self.bg_thread.join()
def set_rollover_info(self, name, info):
if info is None:
self.rollover_info.pop(name, None)
return
self.rollover_info[name] = info
def clear_rollover_info(self):
self.rollover_info.clear()