write logs for inference and loader to file

This commit is contained in:
Alex Bezdieniezhnykh
2025-06-14 16:08:32 +03:00
parent 8aa2f563a4
commit 6f297c4ebf
30 changed files with 218 additions and 140 deletions
+3 -2
View File
@@ -1,6 +1,7 @@
import threading
from threading import Thread
import traceback
cimport constants
from credentials cimport Credentials
from remote_command cimport RemoteCommand, CommandType
from remote_command_handler cimport RemoteCommandHandler
@@ -29,7 +30,7 @@ cdef class CommandProcessor:
self.shutdown_event.wait(timeout=1.0)
except Exception as e:
traceback.print_exc()
print('EXIT!')
constants.log('EXIT!')
cdef on_command(self, RemoteCommand command):
@@ -66,7 +67,7 @@ cdef class CommandProcessor:
else:
pass
except Exception as e:
print(f"Error handling client: {e}")
constants.logerror(f"Error handling client: {e}")
err_command = RemoteCommand(CommandType.ERROR, None, str(e))
self.remote_handler.send(command.client_id, err_command.serialize())