From d3db7a0631622a5100b1e410a11541e91a97072c Mon Sep 17 00:00:00 2001 From: Furkan Bilgin Date: Thu, 26 Dec 2024 02:40:44 +0300 Subject: [PATCH] feat: add debug logging for message output in DAQJob --- src/enrgdaq/daq/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/enrgdaq/daq/base.py b/src/enrgdaq/daq/base.py index ecb3fc6..d0795e2 100644 --- a/src/enrgdaq/daq/base.py +++ b/src/enrgdaq/daq/base.py @@ -6,12 +6,15 @@ from queue import Empty, Queue from typing import Any, Optional +import msgspec + from enrgdaq.daq.models import ( DAQJobConfig, DAQJobInfo, DAQJobMessage, DAQJobMessageStop, DAQJobStopError, + LogVerbosity, ) from enrgdaq.daq.store.models import DAQJobMessageStore from enrgdaq.models import SupervisorConfig @@ -177,6 +180,9 @@ def _put_message_out(self, message: DAQJobMessage): if store_remote_config is not None: message.remote_config = store_remote_config + if self.config.verbosity == LogVerbosity.DEBUG: + msg_json = msgspec.json.encode(message) + self._logger.debug(f"Message out: {msg_json}") self.message_out.put(message) def __del__(self):