- Timestamp:
- Jul 9, 2013, 9:33:56 AM (11 years ago)
- Location:
- trunk/docs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/api/zoo-process.txt
r348 r437 4 4 =========== 5 5 6 Used to query OGC WPS process defined by its URL and its identifier. Useful lfor chaining localhost process.6 Used to query OGC WPS process defined by its URL and its identifier. Useful for chaining localhost process. 7 7 8 8 Properties and Functions -
trunk/docs/services/debug.txt
r406 r437 13 13 ---- 14 14 15 Using the web request you can see any problem withthe log file of Apache.15 Using the web request you can see any problem in the log file of Apache. 16 16 17 On Unix system usually to log file is in ``/var/log/apache2`` and the usefulfile18 is ``error_log``. A simple way to look inside the file is to use ``tail`` command,17 On Unix system the log file is usually in ``/var/log/apache2`` and the relevant file 18 is ``error_log``. A simple way to read the file is to use the ``tail`` command, 19 19 it permits to see the update of the file for each request :: 20 20 21 21 tail -f /var/log/apache2/error_log 22 22 23 If the log is not so clear you can add some information insideyour code. You have to write24 in thestandard error.23 If the log is not clear enough you can add some more debug information to your code. You have to write 24 to standard error. 25 25 26 26 Python 27 27 ******** 28 Using Python for example you cando this28 Using Python, you can for example do this 29 29 30 30 .. code-block:: python … … 32 32 import sys 33 33 34 #add this line when you want see yourmessage34 #add this line when you want see an own message 35 35 sys.stderr.write("My message") 36 36 … … 40 40 ************ 41 41 42 You can user ``alert`` to print a string to the standard error.42 You can user ``alert`` to print a string to standard error: 43 43 44 44 .. code-block:: javascript 45 45 46 // add this line when you want see yourmessage46 // add this line when you want see an own message 47 47 alert('My message') 48 48 // you can debug value of inputs, outputs or conf 49 49 alert(inputs["S"]["value"]) 50 50 51 .. note:: If you try to pass an object it return only``[object Object]``51 .. note:: If you try to pass an object it will only return ``[object Object]`` 52 52 53 53 Command line … … 55 55 56 56 It is possible to use the ZOO kernel ``zoo_loader.cgi`` also from command line. 57 This is really useful to debug in a deeper way your service .57 This is really useful to debug in a deeper way your service: 58 58 59 59 .. code-block:: bash 60 60 61 # to use it you have to copy test_service.py and HelloPy.zcfg from61 # in order to use it you have to copy test_service.py and HelloPy.zcfg from 62 62 # the example services 63 63 ./zoo_loader.cgi "service=wps&version=1.0.0&request=execute&identifier=HelloPy&datainputs=a=your name&responsedocument=Result" 64 64 65 Using this way you can use standard debug system of theprogramming language used66 inyour service.65 Working this way you can use the standard debug system of the actual programming language used 66 to develop your service. 67 67 68 68 GDB 69 69 ***** 70 70 From command line you can use also the command line tool `GDB <http://www.gnu.org/software/gdb/>`_ 71 to debug ``zoo_loader.cgi``, you have to run 71 to debug ``zoo_loader.cgi``, you have to run: 72 72 73 73 .. code-block:: bash … … 78 78 run "service=wps&version=1.0.0&request=execute&identifier=HelloPy&datainputs=a=your name&responsedocument=Result" 79 79 80 At this point you can ask help tothe `ZOO mailing list <http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss>`_80 At this point you can ask help at the `ZOO mailing list <http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss>`_ 81 81 copying the result of the command. 82 82 83 83 Python 84 84 ********** 85 For Python you can use ``pdb``, more info at http://docs.python.org/2/library/pdb.html85 For Python, you can use ``pdb``, more info at http://docs.python.org/2/library/pdb.html 86 86 87 87 .. code-block:: python … … 89 89 import pdb 90 90 91 # add this line when you want investigate more in the code91 # add this line when you want investigate your code in more detail 92 92 pdb.set_trace() 93 93
Note: See TracChangeset
for help on using the changeset viewer.