Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aos
GitHub Repository: aos/docker-otel-lgtm
Path: blob/main/docker/logging.sh
401 views
1
#!/bin/bash
2
3
set -euo pipefail
4
5
function run_with_logging(){
6
name=$1
7
shift
8
envvar=$1
9
shift
10
command=$*
11
if [[ ${envvar} == "true" || ${ENABLE_LOGS_ALL:-false} == "true" ]]; then
12
echo "Running ${name} logging=true"
13
${command}
14
else
15
echo "Running ${name} logging=false"
16
${command} > /dev/null 2>&1
17
fi
18
}
19
20