From 2bb456b315fdd5f7eee557a851980f5802532007 Mon Sep 17 00:00:00 2001 From: Eloston Date: Wed, 5 Sep 2018 06:02:20 +0000 Subject: [PATCH] devutils: Make {update,validate}_patches.py output more readable --- devutils/update_patches.py | 6 +++++- devutils/validate_patches.py | 14 +++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/devutils/update_patches.py b/devutils/update_patches.py index 391eb7f0..22de2509 100755 --- a/devutils/update_patches.py +++ b/devutils/update_patches.py @@ -191,7 +191,11 @@ def _refresh_patches(patch_trie, bundle_cache, series_path, run_quilt, abort_on_ _LOGGER.error('Got exit status %s while refreshing %s', result.returncode, patch_path_str) if result.stdout: - _LOGGER.error('stdout: %s', result.stdout.rstrip('\n')) + _LOGGER.error( + """stdout from command: +>>>>>>>>>>>> BEGIN STDOUT <<<<<<<<<<<< +%s +############ END STDOUT ############""", result.stdout.strip('\n')) branch_validation_failed = True had_failure = True break diff --git a/devutils/validate_patches.py b/devutils/validate_patches.py index 655b5255..f90ecadc 100755 --- a/devutils/validate_patches.py +++ b/devutils/validate_patches.py @@ -590,15 +590,19 @@ def _apply_child_bundle_patches(child_path, had_failure, file_layers, patch_cach _apply_file_unidiff(patched_file, file_layers.maps[0], file_layers.parents) except _PatchValidationError as exc: # Branch failed validation; abort - get_logger().error("Validation failure for file '%s' from patch '%s': %s", - patched_file.path, patch_path_str, str(exc)) + get_logger().warning('Patch failed validation: %s', patch_path_str) + get_logger().debug('Specifically, file "%s" failed validation: %s', + patched_file.path, exc) branch_validation_failed = True had_failure = had_failure or not patches_outdated break - except BaseException as exc: + except BaseException: # Branch failed validation; abort - get_logger().exception("Error processing file '%s' from patch '%s': %s", - patched_file.path, patch_path_str, str(exc)) + get_logger().warning('Patch failed validation: %s', patch_path_str) + get_logger().debug( + 'Specifically, file "%s" caused exception while applying:', + patched_file.path, + exc_info=True) branch_validation_failed = True had_failure = had_failure or not patches_outdated break