From 8f257b0517520d422cb1353fe230a6c254b7e165 Mon Sep 17 00:00:00 2001 From: Roy Willy Haug Date: Wed, 20 Mar 2024 08:27:33 +0100 Subject: [PATCH] Add objectUuid to logs that are sent to server so front-end can get all msgs related to a case --- src/sumo/wrapper/_logging.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sumo/wrapper/_logging.py b/src/sumo/wrapper/_logging.py index 8b080ac..a28af21 100644 --- a/src/sumo/wrapper/_logging.py +++ b/src/sumo/wrapper/_logging.py @@ -20,6 +20,9 @@ def emit(self, record): "funcname": record.funcName, "linenumber": record.lineno, } + if "objectUuid" in record.__dict__.keys(): + json["objectUuid"] = record.__dict__.get("objectUuid") + self._sumoClient.post("/message-log/new", json=json) except Exception: # Never fail on logging