How to turn on Debugging?
Hi, It's not very well documented - or at least I wasn't having luck finding mention in the docs - how to properly turn on debugging for yt. After some time digging through the source, I have found that this is handled through the *logging* module - a standard module, which I am not (but should be) familiar with. Anyhow, I have gathered that I can turn on debugging by adding the following two lines to my ~/.yt/config file: [yt] LogFile = True LogLevel = 0 Is this the recommended usage? Is there an easier way to turn debugging on for, say, a single iyt or yt invocation via a command line argument? Chris
Hi Chris,
On Mon, Dec 13, 2010 at 3:24 PM, Chris Malone
Hi,
It's not very well documented - or at least I wasn't having luck finding mention in the docs - how to properly turn on debugging for yt. After some time digging through the source, I have found that this is handled through the *logging* module - a standard module, which I am not (but should be) familiar with.
Anyhow, I have gathered that I can turn on debugging by adding the following two lines to my ~/.yt/config file:
[yt] LogFile = True LogLevel = 0
Is this the recommended usage? Is there an easier way to turn debugging on for, say, a single iyt or yt invocation via a command line argument?
It depends on what you want to do. What you've put in there -- which I agree should be better documented -- will turn on debugging statements that have been sprinkled throughout the source by the developers. This won't necessarily help out if you have a traceback or other error, in which case some of the techniques in "Debugging and Driving" might help: http://yt.enzotools.org/doc/advanced/debugdrive.html You might also try just running with the "pdb" module: python2.6 -m pdb your_script.sh This will put you into a postmortem phase where you can inspect the code if an exception occurs. -Matt
Chris
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Matt,
Thanks for the link - that is what I was looking for, but for some reason
was unable to find...
Chris
On Mon, Dec 13, 2010 at 6:26 PM, Matthew Turk
Hi Chris,
Hi,
It's not very well documented - or at least I wasn't having luck finding mention in the docs - how to properly turn on debugging for yt. After some time digging through the source, I have found that this is handled
On Mon, Dec 13, 2010 at 3:24 PM, Chris Malone
wrote: through the *logging* module - a standard module, which I am not (but should be) familiar with.
Anyhow, I have gathered that I can turn on debugging by adding the following two lines to my ~/.yt/config file:
[yt] LogFile = True LogLevel = 0
Is this the recommended usage? Is there an easier way to turn debugging on for, say, a single iyt or yt invocation via a command line argument?
It depends on what you want to do. What you've put in there -- which I agree should be better documented -- will turn on debugging statements that have been sprinkled throughout the source by the developers. This won't necessarily help out if you have a traceback or other error, in which case some of the techniques in "Debugging and Driving" might help:
http://yt.enzotools.org/doc/advanced/debugdrive.html
You might also try just running with the "pdb" module:
python2.6 -m pdb your_script.sh
This will put you into a postmortem phase where you can inspect the code if an exception occurs.
-Matt
Chris
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Chris Malone
-
Matthew Turk