Toggling back and forth between, error, etc. and print()

I often put print statements in my code so that running the program gives me some feedback on how things are progressing., st.error, etc. play a similar role in front end applications. This sometimes leaves me with a lot of redundant statements. I would like to have a way to toggle back and forth so that I can have a combined function – + print – that sends the output both places. Any ideas?