[pbs-devel] applied: [PATCH] log: only print error level to syslog/stderr
Gabriel Goller
g.goller at proxmox.com
Mon Oct 21 09:48:14 CEST 2024
On 18.10.2024 19:03, Thomas Lamprecht wrote:
>Am 18/10/2024 um 13:11 schrieb Gabriel Goller:
>> We only want to print the error level, and not all the levels below
>> error to stderr/syslog.
>>
>> Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
>> ---
>>
>> Note: the sign was reversed "<=" would have been correct, because we
>> want to print everything that's *less* verbose than Level::ERROR, but
>
>Yeah, this can be easily confusing w.r.t. level and ordered by higher
>verbosity or higher impact..
>
>> there is nothing lower than ERROR, so == is better.
>
>probably stems from thinking about syslog, where there is CRIT, ALERT and
>EMERG as higher (=worse) level than error.
>
>FWIW, while all those levels are maybe a bit much, I miss at least the NOTICE
>one that sits between INFO and WARNING and a higher ERROR one could be useful
>for security/data-impact situations.
Sadly that's not currently possible with tracing (it's also not really
planned), althought we could do something like:
tracing::error!(custom_level = "emergency", "emergency log message");
and then in the custom layer read the attribute and set the syslog
EMERGENCY level.
>>
>> proxmox-log/src/lib.rs | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>
>
>applied, thanks!
Thanks!
More information about the pbs-devel
mailing list