Move logging setup into the script wrapper, turn cbuildbot back to info.
If logging is triggered via a pathway that isn't contained by
chromite.scripts.wrapper, then python logging automatically creates
a default handler.
Via this, logging format is controllable per script (more importantly,
this is the right spot for it).
Finally, the actual change; adjust cbuildbot output dependant on --debug.
This is a crappy option to control it via (since --debug means --dryrun),
but it's the best option at this point and is useful for fodder for getting
us to properly rename the option. In the process restore logging levels
back to info, which they were prior to 4f6ffaf (I65a528924).
BUG=chromium-os:30886
TEST=cbuildbot <target> # now spits infos or higher, no more debug.
TEST=cbuildbot <target> --debug # spits everything.
Change-Id: Ic28f1130e1d298bd66f5a3845cb2be3f86b47d14
Reviewed-on: https://gerrit.chromium.org/gerrit/22552
Commit-Ready: Brian Harring <ferringb@chromium.org>
Reviewed-by: Brian Harring <ferringb@chromium.org>
Tested-by: Brian Harring <ferringb@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 6a9ee91..480b85e 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -872,6 +872,11 @@
Args:
options, args: The options/args object returned by optparse
"""
+ # Setup logging levels first so any parsing triggered log messages
+ # are appropriately filtered.
+ logging.getLogger().setLevel(
+ logging.DEBUG if options.debug else logging.INFO)
+
if options.chrome_root:
if options.chrome_rev != constants.CHROME_REV_LOCAL:
cros_lib.Die('Chrome rev must be %s if chrome_root is set.' %