btrfs-progs: property: use pr_verbose for messages

Replace printf by the level-aware helper. No change for commands that
don't have the global -q/-v options, otherwise the output can be
quieted.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-10-04 16:50:09 +02:00
parent a2ab9a56ce
commit c98f9d0392
1 changed files with 4 additions and 4 deletions

View File

@ -141,7 +141,7 @@ static int prop_read_only(enum prop_object_type type,
return -errno;
}
printf("ro=%s\n", read_only ? "true" : "false");
pr_verbose(LOG_DEFAULT, "ro=%s\n", read_only ? "true" : "false");
}
return 0;
@ -162,7 +162,7 @@ static int prop_label(enum prop_object_type type,
ret = get_label((char *) object, label);
if (!ret)
fprintf(stdout, "label=%s\n", label);
pr_verbose(LOG_DEFAULT, "label=%s\n", label);
}
return ret;
@ -226,7 +226,7 @@ static int prop_compression(enum prop_object_type type,
error("failed to get compression for %s: %m", object);
goto out;
}
fprintf(stdout, "compression=%.*s\n", (int)len, buf);
pr_verbose(LOG_DEFAULT, "compression=%.*s\n", (int)len, buf);
}
ret = 0;
@ -420,7 +420,7 @@ static int dump_prop(const struct prop_handler *prop,
if (!name_and_help)
ret = prop->handler(type, object, prop->name, NULL, false);
else
printf("%-20s%s\n", prop->name, prop->desc);
pr_verbose(LOG_DEFAULT, "%-20s%s\n", prop->name, prop->desc);
}
return ret;
}