aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-log-follow
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ak-log-follow')
-rwxr-xr-xbin/ak-log-follow13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/ak-log-follow b/bin/ak-log-follow
new file mode 100755
index 0000000..33e5587
--- /dev/null
+++ b/bin/ak-log-follow
@@ -0,0 +1,13 @@
+#!/bin/bash
+tail -f $AK_LOGSFILE | while read -r p || [ -n "$p" ]
+do
+ timestamp="$(echo "$p" | awk '{print $1}')"
+ program="$(echo "$p" | awk '{print $2}')"
+ messagetype="$(echo "$p" | awk '{print $3}')"
+ message="$(echo "$p" | cut -d ' ' -f4-)"
+ printf '%s \033[1;32m%s\033[0;00m \033[1;31m%s\033[0;00m %s\n' \
+ "$(date --date=@$timestamp +%Y%m%d_%H%M%S)" \
+ "$program" \
+ "$messagetype" \
+ "$message"
+done