equal
deleted
inserted
replaced
16 # You should have received a copy of the GNU Lesser General Public License along |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """Server subcube of cubicweb : defines objects used only on the server |
18 """Server subcube of cubicweb : defines objects used only on the server |
19 (repository) side |
19 (repository) side |
20 |
20 |
21 This module contains functions to initialize a new repository. |
21 The server module contains functions to initialize a new repository. |
22 """ |
22 """ |
23 |
23 |
24 from __future__ import with_statement |
24 from __future__ import with_statement |
25 |
25 |
26 __docformat__ = "restructuredtext en" |
26 __docformat__ = "restructuredtext en" |
37 from cubicweb import CW_SOFTWARE_ROOT |
37 from cubicweb import CW_SOFTWARE_ROOT |
38 |
38 |
39 # server-side debugging ######################################################### |
39 # server-side debugging ######################################################### |
40 |
40 |
41 # server debugging flags. They may be combined using binary operators. |
41 # server debugging flags. They may be combined using binary operators. |
42 DBG_NONE = 0 # no debug information |
42 |
43 DBG_RQL = 1 # rql execution information |
43 #:no debug information |
44 DBG_SQL = 2 # executed sql |
44 DBG_NONE = 0 #: no debug information |
45 DBG_REPO = 4 # repository events |
45 #: rql execution information |
46 DBG_MS = 8 # multi-sources |
46 DBG_RQL = 1 |
47 DBG_MORE = 16 # more verbosity |
47 #: executed sql |
48 DBG_ALL = 1 + 2 + 4 + 8 + 16 |
48 DBG_SQL = 2 |
49 # current debug mode |
49 #: repository events |
|
50 DBG_REPO = 4 |
|
51 #: multi-sources |
|
52 DBG_MS = 8 |
|
53 #: more verbosity |
|
54 DBG_MORE = 16 |
|
55 #: all level enabled |
|
56 DBG_ALL = DBG_RQL + DBG_SQL + DBG_REPO + DBG_MS + DBG_MORE |
|
57 |
|
58 #: current debug mode |
50 DEBUG = 0 |
59 DEBUG = 0 |
51 |
60 |
52 def set_debug(debugmode): |
61 def set_debug(debugmode): |
53 """change the repository debugging mode""" |
62 """change the repository debugging mode""" |
54 global DEBUG |
63 global DEBUG |