Commit Graph

21 Commits

Author SHA1 Message Date
Thomas Haller
d15f5420c7 contrib: use less -f in NM-log to avoid prompt for non-text input 2022-06-10 08:24:58 +02:00
Thomas Haller
5a5d9573e1 contrib: colorize releasing slave in NM-log 2022-02-23 17:07:16 +01:00
Thomas Haller
39d71ee356 contrib: update NM-log script to highlight "enslaving to master" messages 2021-06-11 10:54:15 +02:00
Thomas Haller
67cc4544f7 scripts: use "/bin/cat" in NM-log
Ubuntu 16.04 doesn't have merged /usr directories and cat is in
/bin/cat.
2020-08-17 10:58:19 +02:00
Thomas Haller
0bff8d7710 contrib: fix detection of whether being sourced in NM-log script 2019-10-26 14:22:44 +02:00
Thomas Haller
9992ac1cf8 platform: add routing-rule add/delete netlink functions 2019-03-13 09:03:59 +01:00
Thomas Haller
bfd6d608e2 contrib: set shift for less in NM-log 2019-03-13 09:03:58 +01:00
Thomas Haller
cce3c0c63d contrib: adjust NM-log for changes to platform logging
Fixes: 8f107f5c00
2018-12-30 15:17:11 +01:00
Thomas Haller
6978558e8c contrib: adjust NM-log for changes to platform logging
Fixes: 8f107f5c00
2018-10-23 12:03:59 +02:00
Thomas Haller
3d41812945 contrib: add -h option to NM-log
Pass "-h" to highlight individual words.
"-h" stands for "highlight".

  $ NM-log -h wlan0 j
2018-02-12 13:06:49 +01:00
Thomas Haller
7573594a21 platform: merge nm_platform_*_delete() delete functions
It only makes sense to call delete() with NMPObjects that
we obtained from the platform cache. Otherwise, if we didn't
get it from the cache in the first place, we wouldn't know
what to delete.

Hence, the input argument is (almost) always an NMPObject
in the first place. That is different from add(), where
we might create a new specific NMPlatform* instance on the
stack. For add() it makes slightly more sense to have different
functions depending on the type. For delete(), it doesn't.
2017-12-11 10:30:26 +01:00
Thomas Haller
8649fcf02a contrib: use less in NM-log to pre-process input
GNU less supports filters. That makes it nice to use instead of cat.
Also, less is well suited for output to a pipe.

With this, `NM-log nm-log.txt.gz` works as you would expect
2017-11-21 15:14:32 +01:00
Thomas Haller
102a58bb62 contrib/scripts: fix coloring for platform messages in NM-log for old logs
Older logfiles contain

  platform: route: adding or updating IPv4 route: 10.1.0

Hightlight that too.
2017-10-03 15:35:56 +02:00
Thomas Haller
18f53a8b30 contrib/scripts: update coloring for platform messages in NM-log (2)
Fixes: 9344013977
2017-09-25 18:36:08 +02:00
Thomas Haller
9344013977 contrib/scripts: update coloring for platform messages in NM-log 2017-09-25 15:13:02 +02:00
Thomas Haller
66a09b2192 contrib/NM-log: don't use exec in bash functions
When sourcing the file, using exec inside NM-show-journal is a bad idea,
because it replaces the calling shell.
2017-09-08 17:18:32 +02:00
Thomas Haller
d4a5e2b1c8 contrib/NM-log: don't run less with --quit-on-intr argument
I find it annoying when ^C exits less and it prompts me to often
do `NM-log | less -R` instead.
2017-09-07 14:45:26 +02:00
Thomas Haller
83e2764050 contrib/NM-log: colorize warnings and errors in red (fix)
Must not colorize the trailing space, otherwise the following
" device" will no longer match.
2017-09-07 14:29:11 +02:00
Thomas Haller
b20fc58b3c 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.
2017-09-07 14:24:56 +02:00
Thomas Haller
cffde0101e contrib/NM-log: improve script and make it sourceable
- use "grep -a" so that grep doesn't refuse to work in binary input.
- make the script source-able to only define the NM-colorize and
  NM-show-journal
- In case the script is sourced, it also defines a NM-log function,
  which does the same as the script itself.
- rename internal functions so that they have names starting with "NM"
  in case of sourcing.
2017-09-07 14:04:13 +02:00
Thomas Haller
1fbd8c079c contrib/scripts: add NM-log helper
To pretty print and colorize NetworkManager logfiles.
2017-08-24 18:40:49 +02:00