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 |
It may be interested to enable a verboser output to debug your RQL statements:
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).
repository debugging context manager / decorator
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
debug mode will be reseted at its original value when leaving the “with” block or the decorated function