summaryrefslogtreecommitdiff
path: root/src/share/common
diff options
context:
space:
mode:
authorMatt Goins <mjgoins@openflows.com>2009-02-01 20:09:39 -0500
committerMatt Goins <mjgoins@openflows.com>2009-02-01 20:09:39 -0500
commit5de2eeb71c3c8f694d990058194afdda7d7f364f (patch)
tree5cfc5a650edf73e093b51225c70506d07fb2bebe /src/share/common
parenta8aa9a5f0d1d1e3832fee0b36f3462992bb5d142 (diff)
parent7548a859412f10e68f90ee68f330593d85b090fc (diff)
Merge commit 'jrollins/master'
Diffstat (limited to 'src/share/common')
-rw-r--r--src/share/common11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/share/common b/src/share/common
index 9adae05..00a1008 100644
--- a/src/share/common
+++ b/src/share/common
@@ -34,7 +34,8 @@ failure() {
# write output to stderr based on specified LOG_LEVEL the first
# parameter is the priority of the output, and everything else is what
-# is echoed to stderr
+# is echoed to stderr. If there is nothing else, then output comes
+# from stdin, and is not prefaced by log prefix.
log() {
local priority
local level
@@ -79,8 +80,12 @@ log() {
output=true
fi
if [ "$priority" = "$level" -a "$output" = 'true' ] ; then
- echo -n "ms: " >&2
- echo "$@" >&2
+ if [ "$1" ] ; then
+ echo -n "ms: " >&2
+ echo "$@" >&2
+ else
+ cat >&2
+ fi
fi
done
}