[PATCH] ubox: logread add option to filter priority (log level)
Hannu Nyman
hannu.nyman at iki.fi
Mon Jul 24 08:20:03 PDT 2023
Paul D kirjoitti 24.7.2023 klo 13.19:
> For those executing this at the command line, how does one 'repeat'?
>
> -v 1 -v 2, or -v1 -v2 or -v123 or -v 1,2,3?
>
> I had to think for a bit since it wasn't immediately obvious.
>
> Perhaps a hint string with "(repeatable eg -v 1 -v 2)"?
>
>
>
> On 2023-07-22 14:40, Legale Legale wrote:
>> From 071cfc2853dd7a4f9fb59a1650de8d5c874ce4f2 Mon Sep 17 00:00:00 2001
>> From:
>> Date: Sat, 22 Jul 2023 01:28:05 +0300
>> Subject: [PATCH] logread: add option to filter priority (log level)
>>
>> This adds an ability to filter log messages priority:
>> -v <log level> handle only messages with given log
>> level (0-7), repeatable
>> -V <log level> ignore messages with given log level
>> (0-7), repeatable
I think that a more normal approach would be same as with kernel log:
defining the minimum seriousness (max level), and printing the items more
serious than that.
https://www.kernel.org/doc/html/next/core-api/printk-basics.html
> The log level specifies the importance of a message. The kernel decides
whether to show the message immediately (printing it to the current console)
depending on its log level and the current console_loglevel (a kernel
variable). If the message priority is higher (lower log level value) than the
console_loglevel the message will be printed to the console.
Simiilar approach of "show log items at least as serious as X" (=loglevel
0-X) would look more natural to me.
There might be also filtering by individual level (with repeatable options),
but the use case is not that obvious.
More information about the openwrt-devel
mailing list