From ffcf1c26c1421d7f627047a47135133bc0d154a2 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Thu, 12 Oct 2023 09:03:11 +0200 Subject: [PATCH] Support remote logging --- trajpred/plumber.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trajpred/plumber.py b/trajpred/plumber.py index 2748e17..74e7c3b 100644 --- a/trajpred/plumber.py +++ b/trajpred/plumber.py @@ -1,4 +1,5 @@ import logging +from logging.handlers import SocketHandler from multiprocessing import Process, Queue from trajpred.config import parser from trajpred.prediction_server import InferenceServer, run_inference_server @@ -14,6 +15,13 @@ def start(): level=loglevel, ) + if args.remote_log_addr: + logging.captureWarnings(True) + root_logger = logging.getLogger() + root_logger.setLevel(logging.NOTSET) # to send all records to cutelog + socket_handler = SocketHandler(args.remote_log_addr, args.remote_log_port) + root_logger.addHandler(socket_handler) + # instantiating process with arguments procs = [ Process(target=run_ws_forwarder, args=(args,))