summaryrefslogtreecommitdiff
path: root/scripts/logger.sh
blob: 8123f0c9f6e3c01f6d06c25d7a6e88654cc261ad (plain)
1
2
3
4
5
6
7
8
9
10
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