commit e7006043ec2a8ce300367f3b3e7b31fff3b40605 parent b3da820aadb460096d5fc974217f61fb3b89fedf Author: dwrz <dwrz@dwrz.net> Date: Sat, 21 Oct 2023 20:54:01 +0000 Add colorize-logs script Diffstat:
A | scripts/colorize-logs | | | 28 | ++++++++++++++++++++++++++++ |
1 file changed, 28 insertions(+), 0 deletions(-)
diff --git a/scripts/colorize-logs b/scripts/colorize-logs @@ -0,0 +1,28 @@ +#!/bin/sh + +awk ' +{ + switch($0) + { + case /"DEBUG"/: + print "\033[35m" $0 "\033[39m" + break + + case /ERROR/: + print "\033[31m" $0 "\033[39m" + break + + case /INFO/: + print "\033[32m" $0 "\033[39m" + break + + case /"WARN"/: + print "\033[33m" $0 "\033[39m" + break + + default: + print $0 + break + } +} +'