summaryrefslogtreecommitdiff
path: root/libdm/libdm-common.c
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2016-05-19 12:19:48 +0200
committerPeter Rajnoha <prajnoha@redhat.com>2016-06-20 11:33:42 +0200
commitf50d4011cdd3ef38c15b9dea05e73321592d93c2 (patch)
treed3231d97b4f24232bf19a70b1429814264426c22 /libdm/libdm-common.c
parentfe63715f25cf156b07e144a2e7b5cce56d32e39e (diff)
downloadlvm2-f50d4011cdd3ef38c15b9dea05e73321592d93c2.tar.gz
log: also pass log_print through report and add log_print_bypass_report for use in libdm-report for direct print without report
log_print is used during cmd line processing to log the result of the operation (e.g. "Volume group vg successfully changed" and similar). We don't want output from log_print to be interleaved with current reports from group where log is reported as well. Also, the information printed by log_print belongs to the log report too, so it should be rerouted to log report if it's set. Since the code in libdm-report which is responsible for doing the report output uses log_print too, we need to use a different kind of log_print which bypasses any log report currently used for logging (...simply, we can't call log_print to output the log report itself which in turn would again reroute to report - the report would never get on output this way).
Diffstat (limited to 'libdm/libdm-common.c')
-rw-r--r--libdm/libdm-common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index d67d0bb3f..6ac936f57 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -116,7 +116,7 @@ static void _default_log_line(int level,
static int _abort_on_internal_errors = -1;
FILE *out = (level & _LOG_STDERR) ? stderr : stdout;
- level &= ~_LOG_STDERR;
+ level &= ~(_LOG_STDERR | _LOG_BYPASS_REPORT);
if (level <= _LOG_WARN || _verbose) {
if (level < _LOG_WARN)