Αρχική Σελίδα > Hacking Invenio > MiscUtil Internals > Remote Debugger |
The remote debugger is a module that makes it easy to plug in different debugging facilities. Debugging is automatically activated using url param debug and can be switched on/off on demand. The module itself is not a debugger, but facilitates calling of diverse debuggers (pdb, gpdb, pydev). This module is meant for Invenio developers and other people who want to edit the Python code, please do not use this module in production environment!.
Debug mode is enabled by passing debug=X in the url parameter, example:
This will run the web application in an interactive mode, debugger in this case is Eclipse/Pydev.http://invenio-ubu/record/94/keywords?ln=en&debug=3
From the module documentation:
Each debugger has its own number: local winpdb: debug=1 remote winpdb: debug=2 remote pydev: debug=3 If debug parameter is empty, the code runs normally. You can also roll out your own debugging functions, assign it new number - look into get_debugger() If you want to change behaviour of the debugger interactively, you can pass arguments encoded in the url, example: http://someurl/collection/X?debug=3|ip:192.168.31.1|port:9999|stderr:0 look at the method signature of each debugger function to see available arguments.
remote_debugger_config.py
file contains:
And if also want to edit modules while Apache is running and see the results immediately, this will force Apache to reload the changed python modules located inside 'lib/python/invenio' but it will not reload anything if you edit var/www/*.py modules.CFG_REMOTE_DEBUGGER_ENABLED = 1
For a more detailed configuration and instructions how to activate individual debuggers, please see the comments inside the remote_debugger.py module -- as this module is for developers, I assume you will find it very easy to understand the rest. Note: if you are using winpdb, then you may want to set the number of WSGI processes to 1 in yourCFG_REMOTE_DEBUGGER_WSGI_RELOAD = ['lib/python/invenio/*.py']
/opt/invenio/etc/apache/invenio-apache-vhost.conf
.