summaryrefslogtreecommitdiffstats
path: root/lib/bb/__init__.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2006-07-08 16:30:02 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2006-07-08 16:30:02 +0000
commit4651e6cf84fea69c52d88b57f7ccc9a322933d7b (patch)
treeb9cbe20a8591f2fc1b2d74b807f07429a22bdd5e /lib/bb/__init__.py
parentda652d60033fc735e6d5000fa05c6c8174ab3125 (diff)
downloadbitbake-4651e6cf84fea69c52d88b57f7ccc9a322933d7b.tar.gz
bitbake/lib/bb/__init__.py:
bitbake/lib/bb/build.py: bitbake/lib/bb/utils.py: bitbake/lib/bb/shell.py: bitbake/lib/bb/providers.py: bitbake/lib/bb/msg.py: bitbake/bin/bitbake: bitbake/bin/bitdoc: bitbake/classes/base.bbclass: Start an overhaul of the message handling in bitbake: - Introduce a new msg module to replace the existing simple calls. - The msg module adds the conncept of message domains so ultimately we can select which kinds of debug messages we want to see (it uses an Enum class for this) - Add a warn logging level for things the user should really pay attention to as note is a little overloaded at present - Start converting to use the new fuctions
Diffstat (limited to 'lib/bb/__init__.py')
-rw-r--r--lib/bb/__init__.py22
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index 8d825dbe8..46043239f 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -69,19 +69,16 @@ __all__ = [
whitespace = '\t\n\x0b\x0c\r '
lowercase = 'abcdefghijklmnopqrstuvwxyz'
-import sys, os, types, re, string
+import sys, os, types, re, string, bb
+from bb import msg
#projectdir = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
projectdir = os.getcwd()
-debug_level = 0
-
if "BBDEBUG" in os.environ:
level = int(os.environ["BBDEBUG"])
if level:
- debug_level = level
- else:
- debug_level = 0
+ bb.msg.set_debug_level(level)
class VarExpandError(Exception):
pass
@@ -100,22 +97,17 @@ class MalformedUrl(Exception):
#######################################################################
#######################################################################
-debug_prepend = ''
-
-
def debug(lvl, *args):
- if debug_level >= lvl:
- print debug_prepend + 'DEBUG:', ''.join(args)
+ bb.msg.std_debug(lvl, ''.join(args))
def note(*args):
- print debug_prepend + 'NOTE:', ''.join(args)
+ bb.msg.std_note(''.join(args))
def error(*args):
- print debug_prepend + 'ERROR:', ''.join(args)
+ bb.msg.std_error(''.join(args))
def fatal(*args):
- print debug_prepend + 'ERROR:', ''.join(args)
- sys.exit(1)
+ bb.msg.std_fatal(''.join(args))
#######################################################################