Redirecting optimize scene output log to a scrollfield

Hi everyone,

I’m doing a small cleanup script in pymel for maya.
One of my buttons is just a full optimize scene:

def cleanOptimize():
pm.mel.cleanUpScene(3)

I’m writing a small message for all my buttons into a scrollfield, and I’d like to send the log that the optimize scene does in the script editor history to my scrollField
If possible I’d like to avoid writing a txt file to do that. I can’t find any way of doing this.

Thanks !!!

Hey @Diablito_Kun, welcome to the forum :slightly_smiling_face:

You could potentially re-path stdout, but i think you want the output of the logger itself right? I’ll keep digging but you may need a custom handler for it.

thanks for your answer, I’ll dig into this, never touched the logger yet