Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/collective/Products.PDBDebugMode
Enable various PDB debugging when Zope debug-mode=on
https://github.com/collective/Products.PDBDebugMode
Last synced: 8 days ago
JSON representation
Enable various PDB debugging when Zope debug-mode=on
- Host: GitHub
- URL: https://github.com/collective/Products.PDBDebugMode
- Owner: collective
- Created: 2013-04-10T22:07:11.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-05-25T07:06:02.000Z (over 1 year ago)
- Last Synced: 2024-10-01T20:18:27.447Z (about 1 month ago)
- Language: Python
- Size: 69.3 KB
- Stars: 2
- Watchers: 113
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.txt
Awesome Lists containing this project
- awesome-plone - Products.PDBDebugMode - Post-mortem debugging: open a pdb session whenever an exception occurs so you you can find out what is going wrong. Plus: By adding /pdb to a url you end up you in a pdb session on the current context. A killer tool for developers. (Develop)
README
===============================================
Products.PDBDebugMode
===============================================
Enable various PDB debugging when debug-mode=on
-----------------------------------------------When Zope is running in debug mode this product hooks PDB debugging
into various parts of a Zope instance. Some additional Plone specific
hooks are also included.Requirements
------------This version of PDBDebugMode has been tested with Zope4 and Plone 5.2 in
Python 2.7, 3.6 and 3.7For Zope 2 (until Plone 5.1) please use `Products.PDBDebugMode = 1.3`.
If ipdb (http://pypi.python.org/pypi/ipdb) is available, it will use that
instead of standard pdb.Its recommended that you use an editor or IDE that can cooperate with
pdb. Emacs for example, will display the corresponding lines of the
source file alongside the pdb prompt.Remember that this product does nothing unless zope is being run with
debug-mode=on such as with "./bin/instance fg"Post-Mortem Debugging
---------------------To provide for better investigation of errors, any error or exception
logged with the python logging module will invoke pdb.post_mortem() if
a traceback can be retrieved and set_trace will be invoked otherwise.
Since the Zope error_log exception handler uses the logging module
when logging errors, this provides for post mortem debugging of Zope
errors. It is often useful, for example, to remove NotFound or
Unauthorized from the ignored exception in error_log and then
investigate such errors with PDB.Runcall Requests
----------------Any request that has the key 'pdb_runcall' will call the result of the
request traversal in the debugger thus allowing for stepping through
the resulting execution. To debug a POST or any other request which
might be tricky to insert the 'pdb_runcall' key into, use
'?toggle_runcall=1' at the end of a URL immediately preceding the
POST to set a 'pdb_runcall' cookie which will then invoke the
pdb.runcall when the POST is submitted. Use '?toggle_runcall=1' at
the end of a URL to clear the cookie. Remember that the cookie will
be set at the level in the hierarchy that it was set.Debug View
----------Additionaly, a view named 'pdb' is registered for all objects that
will simply raise an exception leaving you with the current context to
inspect. Use it for example by calling http://localhost:8080/Plone/foo/@@pdb.Allow Import of pdb
-------------------Import of the pdb module is also allowed in unprotected code such as
python scripts.