From 65cbc9069e15f7f77a0497395a7796906b8ade9a Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Fri, 10 May 2024 20:01:49 +0200 Subject: Initial commit --- logger.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 logger.sh (limited to 'logger.sh') diff --git a/logger.sh b/logger.sh new file mode 100644 index 0000000..600f0ba --- /dev/null +++ b/logger.sh @@ -0,0 +1,10 @@ +_atrocity_log_output="${ATROCITY_LOG:-$(tty)}" +if [ "$_atrocity_log_output" = "not a tty" ]; then + exec {_atrocity_log_descriptor}>&1 +else + exec {_atrocity_log_descriptor}>"$_atrocity_log_output" +fi + +atrocity_debug() { + printf 'DBG : %s\n' "${*}" >&"$_atrocity_log_descriptor" +} -- cgit