summaryrefslogtreecommitdiffstats
path: root/lib/metadata/metadata.c
diff options
context:
space:
mode:
authorAlasdair G Kergon <agk@redhat.com>2012-08-25 20:35:48 +0100
committerAlasdair G Kergon <agk@redhat.com>2012-08-25 20:35:48 +0100
commit438e0050dfed1f8f2d74670a5f7c5e8c8819c777 (patch)
tree72488758b931b28d8a7f4294c9059a6fdd9db379 /lib/metadata/metadata.c
parent4047e4dfb16175daec348bf44032c02181bd4c70 (diff)
downloadlvm2-438e0050dfed1f8f2d74670a5f7c5e8c8819c777.tar.gz
lvm2-438e0050dfed1f8f2d74670a5f7c5e8c8819c777.tar.xz
lvm2-438e0050dfed1f8f2d74670a5f7c5e8c8819c777.zip
config: add silent mode
Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
Diffstat (limited to 'lib/metadata/metadata.c')
-rw-r--r--lib/metadata/metadata.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 205f77ea..220e0c15 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -623,7 +623,7 @@ int vg_remove(struct volume_group *vg)
stack;
if (ret)
- log_print("Volume group \"%s\" successfully removed", vg->name);
+ log_print_unless_silent("Volume group \"%s\" successfully removed", vg->name);
else
log_error("Volume group \"%s\" not properly removed", vg->name);
@@ -988,8 +988,8 @@ uint64_t extents_from_size(struct cmd_context *cmd, uint64_t size,
{
if (size % extent_size) {
size += extent_size - size % extent_size;
- log_print("Rounding up size to full physical extent %s",
- display_size(cmd, size));
+ log_print_unless_silent("Rounding up size to full physical extent %s",
+ display_size(cmd, size));
}
if (size > (uint64_t) MAX_EXTENT_COUNT * extent_size) {
@@ -1305,7 +1305,7 @@ static int _wipe_sb(struct device *dev, const char *type, const char *name,
return 0;
}
- log_print("Wiping %s on %s.", type, name);
+ log_print_unless_silent("Wiping %s on %s.", type, name);
if (!dev_set(dev, superblock, wipe_len, 0)) {
log_error("Failed to wipe %s on %s.", type, name);
return 0;
@@ -1477,7 +1477,7 @@ static int _pvcreate_write(struct cmd_context *cmd, struct pv_to_create *pvc)
return 0;
}
- log_print("Physical volume \"%s\" successfully created", pv_name);
+ log_print_unless_silent("Physical volume \"%s\" successfully created", pv_name);
return 1;
}