pingtimeout commented on code in PR #2156: URL: https://github.com/apache/polaris/pull/2156#discussion_r2228892041
########## releasey/libs/_log.sh: ########## @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# +# Common Logging Functions +# + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +function print_error() { + echo -e "${RED}ERROR: $*${NC}" >&2 +} + +function print_success() { + echo -e "${GREEN}SUCCESS: $*${NC}" >&2 +} + +function print_warning() { + echo -e "${YELLOW}WARNING: $*${NC}" >&2 +} + +function print_info() { + echo "INFO: $*" >&2 +} + +function print_command() { + # This function can be used to print the bash commands that are executed by a + # script. It either prints its arguments as-is to file descriptor 3, if it + # is open, or prepends "DEBUG: " and prints them to stdout if it is unset. + # + # This allows the programmatic verification of all commands that are executed + # by a script, by running it as follows: + # + # $ ./script.sh 3>/tmp/script.log + # $ cat /tmp/script.log + # ./gradlew clean build + # rm -rf ./regtests/output Review Comment: I realize that there is some misunderstanding here. This is an example that shows that, when invoking a `script.sh` (a test script, really), and redirect fd `3` to `/tmp/script.log`, then that file contains all the commands that the script would execute. It is just an example, don't read too much into that. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
