Export out logging at real time

Export out logging at real time

Anonymous
Not applicable
493 Views
1 Reply
Message 1 of 2

Export out logging at real time

Anonymous
Not applicable

Hi all, I am using Maya 2017 and at times when I am trying to test a script of mine, it works 'smoothly' but when trying to re-run the script, or when the tool is already opened and re-clicking on the button to execute the function, my whole Maya session seems to hang. No error or whatsoever, as if it is reading the code (not even sure if it is indeed reading the code) as I am unable to get any information from the Script Editor.

 

Wondering if there are any ways, like a debugger or some sort, eg. export/ capture the logging details real time that will actually shows what is going on 'behind the scene'? 

This makes it hard for me to test my tool as I am unable to tell if it is indeed something wrong with my code/ scene/ Maya...

0 Likes
494 Views
1 Reply
Reply (1)
Message 2 of 2

morten_bohne
Advocate
Advocate

not sure I understand your question, but if you want logging to a file, you could use python's logging module:

https://docs.python.org/2/library/logging.html

 

you should be able to find some examples for filehandlers in the logging-cookbook:

https://docs.python.org/2/howto/logging-cookbook.html#logging-cookbook

 

I usually remote debug in PyCharm, but as far as I remember, the free edition doesn't have remote-debugging, so unless you want to go out and buy new software (it's a bit expensive, but a great editor), you'll have to find other ways of doing this

0 Likes