Waiting and looping function

Sorry, I should have asked it clearly.

The function I am calling is using Python log library and those messages are lost and dont disaplay on the Streamlit UI.

Is this the best pattern to grab logging output into st.write