doc/book/en/annexes/rql/debugging.rst
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 18 Aug 2010 16:53:05 +0200
branchstable
changeset 6120 c000e41316ec
parent 5924 b218df942dd4
child 7079 6024de6094f6
permissions -rw-r--r--
[book] some more documentation and cleanups * merged existing facets documentation with the one I've just written and put almost everything within the code * added a note about __depends__ and __recommends__ and about the recommends semantic (extracted from a post on the ml) * added a note about write security checking (extracted from a post on the ml) * fixed some dumb sphinx errors

.. -*- 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
~~~~~~~~~~~~~~~~~~~~~

It may be interested to enable a verboser output to debug your RQL statements:

.. 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