Skip to content

Commit

Permalink
fix(log): fix printf failing sometimes for color logs (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thom-x authored Feb 23, 2022
1 parent 66ba223 commit 1236dc1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion root/etc/services.d/dump1090/run
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ "$SERVICE_ENABLE_DUMP1090" != "false" ]; then
/bin/nc ${RTL_TCP_REMOTE_HOST} ${RTL_TCP_REMOTE_PORT} | /usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS} --ifile -
else
set -eo pipefail
/usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS} 2>&1 | mawk -W interactive '{printf "%c[31m [dump1090]%c[0m %s%s\n", 27, 27, $0}'
/usr/lib/fr24/dump1090 --net --write-json /usr/lib/fr24/public_html/data --raw --quiet --lat ${HTML_SITE_LAT} --lon ${HTML_SITE_LON} ${DUMP1090_ADDITIONAL_ARGS} 2>&1 | mawk -W interactive '{printf "%c[31m [dump1090]%c[0m %s\n", 27, 27, $0}'
# awk -W interactive ... (prefix log messages with color and "[dump1090]")
fi
else
Expand Down
2 changes: 1 addition & 1 deletion root/etc/services.d/fr24feed/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if [ "$SERVICE_ENABLE_FR24FEED" != "false" ]
then
set -eo pipefail
/fr24feed/fr24feed/fr24feed 2>&1 | mawk -W interactive '{printf "%c[34m [fr24feed]%c[0m %s%s\n", 27, 27, $0}'
/fr24feed/fr24feed/fr24feed 2>&1 | mawk -W interactive '{printf "%c[34m [fr24feed]%c[0m %s\n", 27, 27, $0}'
# awk -W interactive ... (prefix log messages with color and "[fr24feed]")
else
tail -f /dev/null
Expand Down
2 changes: 1 addition & 1 deletion root/etc/services.d/http/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if [ "$SERVICE_ENABLE_HTTP" != "false" ]
then
set -eo pipefail
/thttpd -D -h 0.0.0.0 -p 8080 -d /usr/lib/fr24/public_html -l - -M 60 2>&1 | mawk -W interactive '{printf "%c[32m [http]%c[0m %s%s\n", 27, 27, $0}'
/thttpd -D -h 0.0.0.0 -p 8080 -d /usr/lib/fr24/public_html -l - -M 60 2>&1 | mawk -W interactive '{printf "%c[32m [http]%c[0m %s\n", 27, 27, $0}'
# awk -W interactive ... (prefix log messages with color and "[http]")
else
tail -f /dev/null
Expand Down
2 changes: 1 addition & 1 deletion root/etc/services.d/piaware/run
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
if [ "$SERVICE_ENABLE_PIAWARE" != "false" ]
then
set -eo pipefail
/usr/bin/piaware -plainlog 2>&1 | mawk -W interactive '{printf "%c[33m [piaware]%c[0m %s%s\n", 27, 27, $0}'
/usr/bin/piaware -plainlog 2>&1 | mawk -W interactive '{printf "%c[33m [piaware]%c[0m %s\n", 27, 27, $0}'
# awk -W interactive ... (prefix log messages with color and "[piaware]")
else
tail -f /dev/null
Expand Down

0 comments on commit 1236dc1

Please sign in to comment.