summaryrefslogtreecommitdiff
path: root/scripts/logger.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/logger.sh')
-rwxr-xr-xscripts/logger.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/logger.sh b/scripts/logger.sh
new file mode 100755
index 0000000..8123f0c
--- /dev/null
+++ b/scripts/logger.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+now() {
+ awk '/^now/ {time=$3; printf("[%u.%06u]", time / 1000000000, (time % 1000000000) / 1000) ; exit}' /proc/timer_list
+}
+
+label=${1:+ [$1]}
+
+while read line ; do
+ echo "$(now)$label $line"
+done