Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log info for state observer #542

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions moler/device/textualdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,8 +1031,12 @@ def _prompts_observer_callback(self, event):
occurrence = event.get_last_occurrence()
state = occurrence["state"]
line = occurrence["line"]
self._log(level=logging.DEBUG, msg=f"Callback for state {state} for line >>{line}<<")
self._set_state(state)
msg = f"Callback for state {state} for line >>{line}<<"
if self.current_state != state:
self._log(level=logging.INFO, msg=msg)
self._set_state(state)
else:
self._log(level=logging.DEBUG, msg=msg)
if self._check_all_prompts_on_line:
if len(occurrence["list_matched"]) > 1:
prompts = [{item["state"]: item["prompt_regex"]} for item in
Expand Down
Loading