summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPrathmesh Prabhu <pprabhu@chromium.org>2015-07-17 11:40:40 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-07-18 01:05:24 +0000
commit17f0742270498c9ce88af2e61027caca0307ee78 (patch)
tree98ce84f441c1b33d2ce9973f11df8abaf96e887a /scripts
parent6c8a2c9b5298fc506378272930aac6855d199f26 (diff)
downloadchromite-17f0742270498c9ce88af2e61027caca0307ee78.tar.gz
logging: Add knob to suppress PrintBuildbot* logging functions.
This CL adds a knob to modify the behavior of PrintBuildbot* functions. By default, these functions now dump logs in a way that buidbot does not recognize them as special log lines. When the knob is turned on, the buildbot recognizable special log lines are dumped. It also moves these functions to the cros_logging module, because they belong better to the logging module. Finally, by default, the cbuildbot entry point turns on this knob. BUG=chromium:510905 TEST=(1) unittests. (2) Trybot the hell out of this. Change-Id: I739dcbf13a60e20f68a1a692dba0c621ec297524 Reviewed-on: https://chromium-review.googlesource.com/286532 Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org> Commit-Queue: Prathmesh Prabhu <pprabhu@chromium.org> Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cbuildbot.py1
-rw-r--r--scripts/cros_generate_breakpad_symbols.py4
-rw-r--r--scripts/cros_sdk.py2
-rw-r--r--scripts/upload_prebuilts.py2
-rw-r--r--scripts/upload_symbols.py4
-rw-r--r--scripts/upload_symbols_unittest.py2
6 files changed, 8 insertions, 7 deletions
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index f9d013889..b604b9377 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -1078,6 +1078,7 @@ def main(argv):
cros_build_lib.AssertOutsideChroot()
+ logging.EnableBuildbotMarkers()
if options.remote:
logging.getLogger().setLevel(logging.WARNING)
diff --git a/scripts/cros_generate_breakpad_symbols.py b/scripts/cros_generate_breakpad_symbols.py
index 4a581a627..2c7606b30 100644
--- a/scripts/cros_generate_breakpad_symbols.py
+++ b/scripts/cros_generate_breakpad_symbols.py
@@ -99,7 +99,7 @@ def GenerateBreakpadSymbol(elf_file, debug_file=None, breakpad_dir=None,
def _CrashCheck(ret, msg):
if ret < 0:
- cros_build_lib.PrintBuildbotStepWarnings()
+ logging.PrintBuildbotStepWarnings()
logging.warning('dump_syms crashed with %s; %s',
signals.StrSignal(-ret), msg)
@@ -130,7 +130,7 @@ def GenerateBreakpadSymbol(elf_file, debug_file=None, breakpad_dir=None,
if result.returncode:
# A lot of files (like kernel files) contain no debug information,
# do not consider such occurrences as errors.
- cros_build_lib.PrintBuildbotStepWarnings()
+ logging.PrintBuildbotStepWarnings()
_CrashCheck(result.returncode, 'giving up entirely')
if 'file contains no debugging information' in result.error:
logging.warning('no symbols found for %s', elf_file)
diff --git a/scripts/cros_sdk.py b/scripts/cros_sdk.py
index 226413aaa..b47475dd9 100644
--- a/scripts/cros_sdk.py
+++ b/scripts/cros_sdk.py
@@ -633,7 +633,7 @@ def main(argv):
else:
sdk_version = options.sdk_version
if options.buildbot_log_version:
- cros_build_lib.PrintBuildbotStepText(sdk_version)
+ logging.PrintBuildbotStepText(sdk_version)
# Based on selections, determine the tarball to fetch.
if options.sdk_url:
diff --git a/scripts/upload_prebuilts.py b/scripts/upload_prebuilts.py
index 36c9302d6..ccb1dcc19 100644
--- a/scripts/upload_prebuilts.py
+++ b/scripts/upload_prebuilts.py
@@ -473,7 +473,7 @@ class PrebuiltUploader(object):
link_name = 'Prebuilts[%s]: %s' % (self._target, self._version)
url = '%s%s/index.html' % (gs.PUBLIC_BASE_HTTPS_URL,
remote_location[len(gs.BASE_GS_URL):])
- cros_build_lib.PrintBuildbotLink(link_name, url)
+ logging.PrintBuildbotLink(link_name, url)
def _UploadSdkTarball(self, board_path, url_suffix, prepackaged,
toolchains_overlay_tarballs,
diff --git a/scripts/upload_symbols.py b/scripts/upload_symbols.py
index d7fd0370c..c6f9a114d 100644
--- a/scripts/upload_symbols.py
+++ b/scripts/upload_symbols.py
@@ -327,7 +327,7 @@ def UploadSymbol(upload_url, sym_item, file_limit=DEFAULT_FILE_LIMIT,
# Not sure what the best answer is in this case.
file_size = os.path.getsize(upload_item.sym_file)
if file_size > CRASH_SERVER_FILE_LIMIT:
- cros_build_lib.PrintBuildbotStepWarnings()
+ logging.PrintBuildbotStepWarnings()
logging.warning('upload file %s is awfully large, risking rejection by '
'the symbol server (%s > %s)', sym_file, file_size,
CRASH_SERVER_FILE_LIMIT)
@@ -737,7 +737,7 @@ def UploadSymbols(board=None, official=False, server=None, breakpad_dir=None,
# The process is taking too long, so kill it and complain.
if storage_notify_proc.is_alive():
logging.warning('notification process took too long')
- cros_build_lib.PrintBuildbotStepWarnings()
+ logging.PrintBuildbotStepWarnings()
# Kill it gracefully first (traceback) before tacking it down harder.
pid = storage_notify_proc.pid
diff --git a/scripts/upload_symbols_unittest.py b/scripts/upload_symbols_unittest.py
index cc3e18e8f..dc70c5379 100644
--- a/scripts/upload_symbols_unittest.py
+++ b/scripts/upload_symbols_unittest.py
@@ -430,7 +430,7 @@ class UploadSymbolTest(cros_test_lib.MockTempDirTestCase):
def testTruncateReallyLargeFiles(self):
"""Verify we try to shrink really big files"""
- warn_mock = self.PatchObject(cros_build_lib, 'PrintBuildbotStepWarnings')
+ warn_mock = self.PatchObject(logging, 'PrintBuildbotStepWarnings')
with open(self.sym_file, 'w+b') as f:
f.truncate(upload_symbols.CRASH_SERVER_FILE_LIMIT + 100)
f.seek(0)