Support remote logging
This commit is contained in:
parent
ee57604b30
commit
ffcf1c26c1
1 changed files with 8 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
|
from logging.handlers import SocketHandler
|
||||||
from multiprocessing import Process, Queue
|
from multiprocessing import Process, Queue
|
||||||
from trajpred.config import parser
|
from trajpred.config import parser
|
||||||
from trajpred.prediction_server import InferenceServer, run_inference_server
|
from trajpred.prediction_server import InferenceServer, run_inference_server
|
||||||
|
@ -14,6 +15,13 @@ def start():
|
||||||
level=loglevel,
|
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
|
# instantiating process with arguments
|
||||||
procs = [
|
procs = [
|
||||||
Process(target=run_ws_forwarder, args=(args,))
|
Process(target=run_ws_forwarder, args=(args,))
|
||||||
|
|
Loading…
Reference in a new issue