Skip to content

Commit

Permalink
feat: add debug logging for message output in DAQJob
Browse files Browse the repository at this point in the history
  • Loading branch information
furkan-bilgin committed Dec 25, 2024
1 parent dfe436b commit d3db7a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/enrgdaq/daq/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit d3db7a0

Please sign in to comment.