summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/__init__.py5
-rw-r--r--bitbake/lib/bb/msg.py17
2 files changed, 10 insertions, 12 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py
index 88641e280b..acd4af13a8 100644
--- a/bitbake/lib/bb/__init__.py
+++ b/bitbake/lib/bb/__init__.py
@@ -43,12 +43,13 @@ class BBLogger(Logger):
43 Logger.__init__(self, name) 43 Logger.__init__(self, name)
44 44
45 def bbdebug(self, level, msg, *args, **kwargs): 45 def bbdebug(self, level, msg, *args, **kwargs):
46 loglevel = logging.DEBUG - level + 1
46 if not bb.event.worker_pid: 47 if not bb.event.worker_pid:
47 if self.name in bb.msg.loggerDefaultDomains and level > (bb.msg.loggerDefaultDomains[self.name]): 48 if self.name in bb.msg.loggerDefaultDomains and loglevel > (bb.msg.loggerDefaultDomains[self.name]):
48 return 49 return
49 if level > (bb.msg.loggerDefaultDebugLevel): 50 if level > (bb.msg.loggerDefaultDebugLevel):
50 return 51 return
51 return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs) 52 return self.log(loglevel, msg, *args, **kwargs)
52 53
53 def plain(self, msg, *args, **kwargs): 54 def plain(self, msg, *args, **kwargs):
54 return self.log(logging.INFO + 1, msg, *args, **kwargs) 55 return self.log(logging.INFO + 1, msg, *args, **kwargs)
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index 33c0e2fa19..d1b0e929d4 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -138,7 +138,7 @@ class BBLogFilterStdOut(BBLogFilter):
138loggerDefaultDebugLevel = 0 138loggerDefaultDebugLevel = 0
139loggerDefaultVerbose = False 139loggerDefaultVerbose = False
140loggerVerboseLogs = False 140loggerVerboseLogs = False
141loggerDefaultDomains = [] 141loggerDefaultDomains = {}
142 142
143def init_msgconfig(verbose, debug, debug_domains=None): 143def init_msgconfig(verbose, debug, debug_domains=None):
144 """ 144 """
@@ -148,15 +148,16 @@ def init_msgconfig(verbose, debug, debug_domains=None):
148 bb.msg.loggerDefaultVerbose = verbose 148 bb.msg.loggerDefaultVerbose = verbose
149 if verbose: 149 if verbose:
150 bb.msg.loggerVerboseLogs = True 150 bb.msg.loggerVerboseLogs = True
151
152 bb.msg.loggerDefaultDomains = {}
151 if debug_domains: 153 if debug_domains:
152 bb.msg.loggerDefaultDomains = debug_domains 154 for (domainarg, iterator) in groupby(debug_domains):
153 else: 155 dlevel = len(tuple(iterator))
154 bb.msg.loggerDefaultDomains = [] 156 bb.msg.loggerDefaultDomains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
155 157
156def constructLogOptions(): 158def constructLogOptions():
157 debug = loggerDefaultDebugLevel 159 debug = loggerDefaultDebugLevel
158 verbose = loggerDefaultVerbose 160 verbose = loggerDefaultVerbose
159 domains = loggerDefaultDomains
160 161
161 if debug: 162 if debug:
162 level = BBLogFormatter.DEBUG - debug + 1 163 level = BBLogFormatter.DEBUG - debug + 1
@@ -165,11 +166,7 @@ def constructLogOptions():
165 else: 166 else:
166 level = BBLogFormatter.NOTE 167 level = BBLogFormatter.NOTE
167 168
168 debug_domains = {} 169 return level, loggerDefaultDomains
169 for (domainarg, iterator) in groupby(domains):
170 dlevel = len(tuple(iterator))
171 debug_domains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
172 return level, debug_domains
173 170
174def addDefaultlogFilter(handler, cls = BBLogFilter, forcelevel=None): 171def addDefaultlogFilter(handler, cls = BBLogFilter, forcelevel=None):
175 level, debug_domains = constructLogOptions() 172 level, debug_domains = constructLogOptions()