Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
#1135 tag log messages with the uid of the outer run
Browse files Browse the repository at this point in the history
  • Loading branch information
d-perl committed Mar 1, 2024
1 parent 26bff70 commit c4f96c4
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from bluesky.callbacks import CallbackBase
from event_model import RunStart, RunStop

from hyperion.log import run_uid_filter
from hyperion.parameters.constants import SET_LOG_UID_TAG


class LogUidTaggingCallback(CallbackBase):
def __init__(self) -> None:
self.run_uid = None

def start(self, doc: RunStart):
if doc.get(SET_LOG_UID_TAG):
self.run_uid = doc.get("uid")
run_uid_filter.run_uid = self.run_uid

def stop(self, doc: RunStop):
if doc.get("run_start") == self.run_uid:
self.run_uid = None
run_uid_filter.run_uid = None

0 comments on commit c4f96c4

Please sign in to comment.