Server debugging flags. They may be combined using binary operators.
To debug your RQL statements, it can be useful to enable a verbose output:
from cubicweb import server
server.set_debug(server.DBG_RQL|server.DBG_SQL|server.DBG_ALL)
See Profiling and performance chapter (see Profiling and performance).
Context manager and decorator to help debug the repository.
It can be used either as a context manager:
>>> with debugged(server.DBG_RQL | server.DBG_REPO):
... # some code in which you want to debug repository activity,
... # seing information about RQL being executed an repository events.
or as a function decorator:
>>> @debugged(server.DBG_RQL | server.DBG_REPO)
... def some_function():
... # some code in which you want to debug repository activity,
... # seing information about RQL being executed an repository events
The debug mode will be reset to its original value when leaving the “with” block or the decorated function.