summaryrefslogtreecommitdiffstats
path: root/common/log.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common/log.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/log.sh b/common/log.sh
new file mode 100644
index 0000000..622a9bb
--- /dev/null
+++ b/common/log.sh
@@ -0,0 +1,15 @@
+# log function for displaying output if loging enabled
+
+_log() {
+ # only output something,
+ # if logging is enabled
+ if [ $LOGGING -eq 0 ]; then
+ if [ -n "$1" ]; then
+ # echo arguments
+ echo "$@"
+ else
+ # echo stdin
+ cat
+ fi
+ fi
+}