btrfs-progs: add logic to handle LOG_DEFAULT messages

There are messages that are supposed to be printed by default and now
use the LOG_ALWAYS level, but that's a negative level and was meant as a
workaround for commands that must really print the message.

The default log level should be 1 and can be adjusted by the -q or -v
global commands.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-10-04 16:19:29 +02:00
parent 8025583af3
commit dd724f2180

View File

@ -115,7 +115,9 @@ void pr_verbose(int level, const char *fmt, ...)
if (bconf.verbose == BTRFS_BCONF_QUIET || level == BTRFS_BCONF_QUIET)
return;
if (bconf.verbose < level)
if (bconf.verbose == BTRFS_BCONF_UNSET && level == LOG_DEFAULT)
/* Pass */;
else if (bconf.verbose < level)
return;
va_start(args, fmt);