diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-05-16 21:55:52 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-05-19 16:55:07 +0300 |
commit | 62f0b16f639a9ecb116a79819655bdf44e269443 (patch) | |
tree | f66dc07c616b3f387f3ec941537e840fce261322 /scripts/logger.sh |
Initial commit
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'scripts/logger.sh')
-rwxr-xr-x | scripts/logger.sh | 11 |
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 |