Skip to content

Comments

Allow an action to get a copy of the logs raised during the action.#260

Open
julianstirling wants to merge 1 commit intomainfrom
get_logs
Open

Allow an action to get a copy of the logs raised during the action.#260
julianstirling wants to merge 1 commit intomainfrom
get_logs

Conversation

@julianstirling
Copy link
Contributor

For very long running tasks with lots of things happening (such as scanning on the OpenFlexure microscope) it is useful to be able to save a copy of the logs for a specific action along with the data created during the action.

This adds a function built into the Thing class to allow the action to retrieve its logs.

return self._return_value

@property
def log(self) -> list[LogRecordModel]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The type hint here was not correct, behaviour has not been changed

@barecheck
Copy link

barecheck bot commented Feb 20, 2026

Barecheck - Code coverage report

Total: 96.47%

Your code coverage diff: 0.05% ▴

Uncovered files and lines
FileLines
src/labthings_fastapi/actions.py508-509, 522, 547-548, 673, 817-818, 821, 824, 872
src/labthings_fastapi/thing.py252, 258, 283-285, 317, 405

@julianstirling julianstirling requested a review from rwb27 February 20, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant