mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-23 22:54:10 -06:00
pyhelper: Add ability to route error messages to python logging
Instead of writing error messages to stderr, route them into the python code and use the standard python logging system. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
b14db404b5
commit
4f07ee4d92
7 changed files with 67 additions and 29 deletions
|
@ -300,7 +300,7 @@ message_alloc_and_encode(uint32_t *data, int len)
|
|||
return qm;
|
||||
|
||||
fail:
|
||||
fprintf(stderr, "Encode error\n");
|
||||
errorf("Encode error");
|
||||
qm->len = 0;
|
||||
return qm;
|
||||
}
|
||||
|
@ -856,7 +856,7 @@ serialqueue_free_commandqueue(struct command_queue *cq)
|
|||
if (!cq)
|
||||
return;
|
||||
if (!list_empty(&cq->ready_queue) || !list_empty(&cq->stalled_queue)) {
|
||||
fprintf(stderr, "Memory leak! Can't free non-empty commandqueue\n");
|
||||
errorf("Memory leak! Can't free non-empty commandqueue");
|
||||
return;
|
||||
}
|
||||
free(cq);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue