Dump Maya script editor log

Hi everyone I’m a little lost with an issue I am trying to solve. I was wondering if someone would be able to swoop in and save me. I would like to basically get the entire contents of the Maya Script editor log and write it to a file. I know I can use cmds.scriptEditorInfo(hf="my\\file\\path.txt", wh=True) to get it outputting to a file, which I could do in Maya start up. But sadly is not an option for me to edit the Maya start.

I am wondering if there are any alternatives? I’ve been trying to open the script editor manually / command window and scene through Open windows and see if I can grab the Qt class and pull info from there but I am not having much luck. I would appreciate any help or advice you can provide :sweat_smile:

Thanks

is it an option to run scriptEditorInfo after startup?
you could easily make a shelf button

or are you trying to capture some kind of startup crash?

Hi, thanks for your response. Something like that. To expand a bit, I’ve written a large python tool for Maya, and a few people I have given it to are getting errors that I am having trouble tracking down. I suspect that some useful info is being printed to the script editor sometime before the actual error occurs. I could ask these people to modify their start-up I suppose but the error is pretty rare and hard to reproduce.

I would like to avoid getting them to manually copy and paste the contents of the script editor itself into a text document for me and would just like a button that grabs it and dumps it to a file just as a convinince and completeness thing. Mostly so I know that they will always give me the full log and not just a partial copy. I could also scriptEditorInfo on start-up of the tool I suppose but at this point, I am sort of obsessed with this even being possible haha. I would also like everything just so I can get a sense of what state there Maya scene is in even before the tool started

you could also call the scriptEditorInfo command in the init of your tool.
that way it will only log the setup when your tool is used as well.