From b20fc58b3c76cc2df049c5b8cdc9a39e2c6ff130 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 7 Sep 2017 14:20:16 +0200 Subject: [PATCH] contrib/NM-log: colorize warnings and errors in red - remove "\r\n" line endings - colorize and in red - extend matching the info levels to include the timestamp. This (intentionally) will no longer highlight messages from ModemManager, which don't include a timestamp. --- contrib/scripts/NM-log | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/scripts/NM-log b/contrib/scripts/NM-log index 7a35b17b10..5f92bbae3c 100755 --- a/contrib/scripts/NM-log +++ b/contrib/scripts/NM-log @@ -34,7 +34,9 @@ NM-colorize() { if [[ "$NM_LOG_NO_COLOR" == "" ]]; then # poor man's coloring using grep. # TODO: do it somehow better (and more efficient). - GREP_COLOR='01;33' grep -a --color=always '^\|^\(.* \)\?<\(warn>\|info> \|error>\) \(.*\.*$\)\?' | \ + sed 's/\r$//' | \ + GREP_COLOR='01;31' grep -a --color=always '^\|^\(.* \)\?<\(warn> \|error>\) \[[0-9.]*\] ' | \ + GREP_COLOR='01;33' grep -a --color=always '^\|^\(.* \)\? \[[0-9.]*\] \(.*\.*$\)\?' | \ GREP_COLOR='01;37' grep -a --color=always '^\|\