diff options
author | Alasdair G Kergon <agk@redhat.com> | 2012-08-25 20:35:48 +0100 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-08-25 20:35:48 +0100 |
commit | 438e0050dfed1f8f2d74670a5f7c5e8c8819c777 (patch) | |
tree | 72488758b931b28d8a7f4294c9059a6fdd9db379 /tools/vgreduce.c | |
parent | 4047e4dfb16175daec348bf44032c02181bd4c70 (diff) | |
download | lvm2-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 'tools/vgreduce.c')
-rw-r--r-- | tools/vgreduce.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/vgreduce.c b/tools/vgreduce.c index 975b9eab..1b04a492 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -193,7 +193,7 @@ static int _vgreduce_single(struct cmd_context *cmd, struct volume_group *vg, backup(vg); - log_print("Removed \"%s\" from volume group \"%s\"", name, vg->name); + log_print_unless_silent("Removed \"%s\" from volume group \"%s\"", name, vg->name); r = ECMD_PROCESSED; bad: if (pvl) @@ -304,8 +304,8 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv) backup(vg); if (fixed) { - log_print("Wrote out consistent volume group %s", - vg_name); + log_print_unless_silent("Wrote out consistent volume group %s", + vg_name); ret = ECMD_PROCESSED; } else ret = ECMD_FAILED; |