diff options
author | Thomas Haller <thaller@redhat.com> | 2017-09-07 14:20:16 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-09-07 14:24:56 +0200 |
commit | b20fc58b3c76cc2df049c5b8cdc9a39e2c6ff130 (patch) | |
tree | d7f5d45f1c8c2f095ab7e8a2d5716a91e850d9b6 | |
parent | cffde0101e38095d3a3d8d7dacc1b23b8a1656f6 (diff) | |
download | NetworkManager-b20fc58b3c76cc2df049c5b8cdc9a39e2c6ff130.tar.gz |
contrib/NM-log: colorize warnings and errors in red
- remove "\r\n" line endings
- colorize <warn> and <error> 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.
-rwxr-xr-x | contrib/scripts/NM-log | 4 |
1 files changed, 3 insertions, 1 deletions
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>\) \(.*\<is starting\>.*$\)\?' | \ + sed 's/\r$//' | \ + GREP_COLOR='01;31' grep -a --color=always '^\|^\(.* \)\?<\(warn> \|error>\) \[[0-9.]*\] ' | \ + GREP_COLOR='01;33' grep -a --color=always '^\|^\(.* \)\?<info> \[[0-9.]*\] \(.*\<is starting\>.*$\)\?' | \ GREP_COLOR='01;37' grep -a --color=always '^\|\<platform: signal: .*$' | \ GREP_COLOR='01;34' grep -a --color=always '^\|\<platform-linux: link: change \|\<platform: link: setting .*$\|\<platform: \(route\|address\): .*$\|\<platform-linux: sysctl: setting .*$' | \ GREP_COLOR='01;35' grep -a --color=always '^\| audit: .*$' | \ |