Skip to content

Commit

Permalink
cleanup extra handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jenshnielsen committed Aug 1, 2023
1 parent b653c21 commit af6a6dc
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qcodes/logger/instrument_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ def process(
Returns the message and the kwargs for the handlers.
"""
assert self.extra is not None
inst = self.extra['instrument']
kwargs["extra"] = {}
kwargs["extra"]["instrument_name"] = str(getattr(inst, "full_name", ""))
kwargs["extra"]["instrument_type"] = str(type(inst))
extra = dict(self.extra)
inst = extra.pop("instrument")

full_name = getattr(inst, "full_name", None)
kwargs["extra"]["instrument_name"] = full_name
instr_type = str(type(inst).__name__)

kwargs["extra"] = extra
kwargs["extra"]["instrument_name"] = str(full_name)
kwargs["extra"]["instrument_type"] = instr_type
return f"[{full_name}({instr_type})] {msg}", kwargs

Expand Down

0 comments on commit af6a6dc

Please sign in to comment.