summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/msg.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/msg.py')
-rw-r--r--bitbake/lib/bb/msg.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index d1b0e929d4..ea6a9543f7 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -135,7 +135,7 @@ class BBLogFilterStdOut(BBLogFilter):
135# Message control functions 135# Message control functions
136# 136#
137 137
138loggerDefaultDebugLevel = 0 138loggerDefaultLogLevel = BBLogFormatter.NOTE
139loggerDefaultVerbose = False 139loggerDefaultVerbose = False
140loggerVerboseLogs = False 140loggerVerboseLogs = False
141loggerDefaultDomains = {} 141loggerDefaultDomains = {}
@@ -144,11 +144,17 @@ def init_msgconfig(verbose, debug, debug_domains=None):
144 """ 144 """
145 Set default verbosity and debug levels config the logger 145 Set default verbosity and debug levels config the logger
146 """ 146 """
147 bb.msg.loggerDefaultDebugLevel = debug
148 bb.msg.loggerDefaultVerbose = verbose 147 bb.msg.loggerDefaultVerbose = verbose
149 if verbose: 148 if verbose:
150 bb.msg.loggerVerboseLogs = True 149 bb.msg.loggerVerboseLogs = True
151 150
151 if debug:
152 bb.msg.loggerDefaultLogLevel = BBLogFormatter.DEBUG - debug + 1
153 elif verbose:
154 bb.msg.loggerDefaultLogLevel = BBLogFormatter.VERBOSE
155 else:
156 bb.msg.loggerDefaultLogLevel = BBLogFormatter.NOTE
157
152 bb.msg.loggerDefaultDomains = {} 158 bb.msg.loggerDefaultDomains = {}
153 if debug_domains: 159 if debug_domains:
154 for (domainarg, iterator) in groupby(debug_domains): 160 for (domainarg, iterator) in groupby(debug_domains):
@@ -156,17 +162,7 @@ def init_msgconfig(verbose, debug, debug_domains=None):
156 bb.msg.loggerDefaultDomains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1 162 bb.msg.loggerDefaultDomains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
157 163
158def constructLogOptions(): 164def constructLogOptions():
159 debug = loggerDefaultDebugLevel 165 return loggerDefaultLogLevel, loggerDefaultDomains
160 verbose = loggerDefaultVerbose
161
162 if debug:
163 level = BBLogFormatter.DEBUG - debug + 1
164 elif verbose:
165 level = BBLogFormatter.VERBOSE
166 else:
167 level = BBLogFormatter.NOTE
168
169 return level, loggerDefaultDomains
170 166
171def addDefaultlogFilter(handler, cls = BBLogFilter, forcelevel=None): 167def addDefaultlogFilter(handler, cls = BBLogFilter, forcelevel=None):
172 level, debug_domains = constructLogOptions() 168 level, debug_domains = constructLogOptions()