Transition to libbe.LOG for logging
[be.git] / libbe / __init__.py
1 # Copyright (C) 2005-2012 Aaron Bentley <abentley@panoramicfeedback.com>
2 #                         Chris Ball <cjb@laptop.org>
3 #                         W. Trevor King <wking@tremily.us>
4 #
5 # This file is part of Bugs Everywhere.
6 #
7 # Bugs Everywhere is free software: you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the Free
9 # Software Foundation, either version 2 of the License, or (at your option) any
10 # later version.
11 #
12 # Bugs Everywhere is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15 # more details.
16 #
17 # You should have received a copy of the GNU General Public License along with
18 # Bugs Everywhere.  If not, see <http://www.gnu.org/licenses/>.
19
20 """The libbe module does all the legwork for bugs-everywhere_ (BE).
21
22 .. _bugs-everywhere: http://bugseverywhere.org
23
24 To facilitate faster loading, submodules are not imported by default.
25 The available submodules are:
26
27 * :py:mod:`libbe.bugdir`
28 * :py:mod:`libbe.bug`
29 * :py:mod:`libbe.comment`
30 * :py:mod:`libbe.command`
31 * :py:mod:`libbe.diff`
32 * :py:mod:`libbe.error`
33 * :py:mod:`libbe.storage`
34 * :py:mod:`libbe.ui`
35 * :py:mod:`libbe.util`
36 * :py:mod:`libbe.version`
37 * :py:mod:`libbe._version`
38 """
39
40 import logging as _logging
41
42
43 LOG = _logging.getLogger('be')
44 LOG.addHandler(_logging.StreamHandler())
45 LOG.setLevel(_logging.ERROR)
46
47
48 TESTING = False
49 """Flag controlling test-suite generation.
50
51 To reduce module load time, test suite generation is turned of by
52 default.  If you *do* want to generate the test suites, set
53 ``TESTING=True`` before loading any :py:mod:`libbe` submodules.
54
55 Examples
56 --------
57
58 >>> import libbe
59 >>> libbe.TESTING = True
60 >>> import libbe.bugdir
61 >>> 'SimpleBugDir' in dir(libbe.bugdir)
62 True
63 """