diff options
author | Linnea Gräf <nea@nea.moe> | 2024-05-10 20:01:49 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-05-10 20:01:49 +0200 |
commit | 65cbc9069e15f7f77a0497395a7796906b8ade9a (patch) | |
tree | 5a36377e458fdf589365c2f1f8d516ae0c35fa37 /logger.sh | |
download | atrocity-65cbc9069e15f7f77a0497395a7796906b8ade9a.tar.gz atrocity-65cbc9069e15f7f77a0497395a7796906b8ade9a.tar.bz2 atrocity-65cbc9069e15f7f77a0497395a7796906b8ade9a.zip |
Initial commit
Diffstat (limited to 'logger.sh')
-rw-r--r-- | logger.sh | 10 |
1 files changed, 10 insertions, 0 deletions
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" +} |