Re: [PATCH] printk: Add loglevel for "do not print to consoles".

From: Petr Mladek
Date: Wed May 13 2020 - 08:34:55 EST


On Wed 2020-05-13 20:03:53, Tetsuo Handa wrote:
> On 2020/05/13 19:04, Petr Mladek wrote:
> >> What is wrong with adding NO_CONSOLES ?
> >
> > How does it differ from KERN_DEBUG? The debug messages:
> >
> > + can be disabled via sysfs
> > + might reach console when this loglevel is enabled
>
> KERN_NO_CONSOLES is different from KERN_DEBUG in that KERN_NO_CONSOLES
> itself does not affect userspace daemon's judgement (whether to filter
> KERN_$LOGLEVEL messages).

And that is the evil thing about it. It goes around the loglevel
filtering.

The administrator wants to decide what messages are important for him.
NO_CONSOLES would mess with this decision. Some messages would suddenly
get hidden on console but appear in userspace. Users would need to
investigate what the hell is happening. They would need to find the
new sysfs knob to restore the expected behavior, etc.

I am strongly against this.

Please, use the existing loglevels to hide messages on
console. Configure your filter to store them in userspace.

Best Regards,
Petr