doc/book/en/annexes/rql/debugging.rst
author Nicolas Chauvat <nicolas.chauvat@logilab.fr>
Tue, 15 Mar 2011 09:41:45 +0100
brancholdstable
changeset 7079 6024de6094f6
parent 5924 b218df942dd4
child 7529 2fdc310be7cd
permissions -rw-r--r--
[doc] fix rql/debugging.rst and server.__init__ docstrings

.. -*- coding: utf-8 -*-

.. _DEBUGGING:

Debugging RQL
-------------

Available levels
~~~~~~~~~~~~~~~~

:DBG_NONE:
    no debug information (current mode)

:DBG_RQL:
    rql execution information

:DBG_SQL:
    executed sql

:DBG_REPO:
    repository events

:DBG_MS:
    multi-sources

:DBG_MORE:
    more verbosity

:DBG_ALL:
    all level enabled


Enable verbose output
~~~~~~~~~~~~~~~~~~~~~

To debug your RQL statements, it can be useful to enable a verbose output:

.. sourcecode:: python

    from cubicweb import server
    server.set_debug(server.DBG_RQL|server.DBG_SQL|server.DBG_ALL)


Detect largest RQL queries
~~~~~~~~~~~~~~~~~~~~~~~~~~~

See `Profiling and performance` chapter (see :ref:`PROFILING`).


API
~~~

.. autofunction:: cubicweb.server.set_debug

.. autoclass:: cubicweb.server.debugged