From dfb5c3dacba0bbfc20c6e7cb8cc725310675e92b Mon Sep 17 00:00:00 2001 From: Kevin Brodsky Date: Wed, 24 Mar 2021 18:31:04 +0000 Subject: Remove *mirror_output* functions This is a partial revert of 7d80bb63583f ("ART: Add '--rerun-failed-tests' option"). There is no user of the *mirror_output* functions since 293eacffcdb9 ("Refactoring functions in test_art_target.sh"). Since these functions introduce unnecessary complications in start_logging, let's remove them. Change-Id: Id167bd59da69539524131fe9ae6b340561336165 --- utils/utils.sh | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/utils/utils.sh b/utils/utils.sh index 2e2d0d79..8a401a22 100644 --- a/utils/utils.sh +++ b/utils/utils.sh @@ -34,11 +34,6 @@ green= yellow= blue= -# Currently all output is appended to a log file if it exists. -# Users can want to have only the new output. -# This is the name of a file, which the new output is mirrored to. -log_file_output_copy="" - info() { echo -e "${blue}INFO: $* ${no_colour}" >&"${info_log}"; } success() { echo -e "${green}SUCCESS: $* ${no_colour}" >&"${success_log}"; } warning() { echo -e "${yellow}WARNING: $* ${no_colour}" >&"${warning_log}"; } @@ -433,23 +428,6 @@ exists() { fi } -# Arguments: -# ${1} - a file name -clear_file() { - safe cat /dev/null > "$1" -} - -# Specify the name of the file which output is mirrored to. -# Arguments: -# ${1} - a file name -mirror_output_to_file() { - log_file_output_copy="$1" -} - -stop_mirror_output() { - log_file_output_copy="" -} - current_log_file="" # Start logging all standard output and error onto a file. @@ -469,11 +447,7 @@ start_logging() { # Standard output is directed to a subprocess, tee, which sends the output # to both a file and the original stdout. - tee_cmd="safe tee -i -a $1" - if [[ -n "${log_file_output_copy}" ]]; then - tee_cmd+=" ${log_file_output_copy}" - fi - exec > >(${tee_cmd}) + exec > >(safe tee -i -a "$1") # Same for standard error. exec 2>&1 } -- cgit v1.2.3