mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
daemon: Split filter parsing and filter defining
Similar to outputs, parser should do parsing only, thus the 'define' logic is going to be stripped from virLogParseAndDefineFilters by replacing calls to this method to virLogSetFilters instead. Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
c9279169a1
commit
30b650b2ba
@ -691,7 +691,7 @@ daemonSetupLogging(struct daemonConfig *config,
|
||||
virLogSetFromEnv();
|
||||
|
||||
if (virLogGetNbFilters() == 0)
|
||||
virLogParseAndDefineFilters(config->log_filters);
|
||||
virLogSetFilters(config->log_filters);
|
||||
|
||||
if (config->log_outputs && virLogGetNbOutputs() == 0)
|
||||
virLogSetOutputs(config->log_outputs);
|
||||
|
@ -476,7 +476,7 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
|
||||
virLogSetFromEnv();
|
||||
|
||||
if (virLogGetNbFilters() == 0)
|
||||
virLogParseAndDefineFilters(config->log_filters);
|
||||
virLogSetFilters(config->log_filters);
|
||||
|
||||
if (config->log_outputs && virLogGetNbOutputs() == 0)
|
||||
virLogSetOutputs(config->log_outputs);
|
||||
|
@ -404,7 +404,7 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
|
||||
virLogSetFromEnv();
|
||||
|
||||
if (virLogGetNbFilters() == 0)
|
||||
virLogParseAndDefineFilters(config->log_filters);
|
||||
virLogSetFilters(config->log_filters);
|
||||
|
||||
if (config->log_outputs && virLogGetNbOutputs() == 0)
|
||||
virLogSetOutputs(config->log_outputs);
|
||||
|
@ -1624,7 +1624,7 @@ virLogSetFromEnv(void)
|
||||
virLogParseDefaultPriority(debugEnv);
|
||||
debugEnv = virGetEnvAllowSUID("LIBVIRT_LOG_FILTERS");
|
||||
if (debugEnv && *debugEnv)
|
||||
virLogParseAndDefineFilters(debugEnv);
|
||||
virLogSetFilters(debugEnv);
|
||||
debugEnv = virGetEnvAllowSUID("LIBVIRT_LOG_OUTPUTS");
|
||||
if (debugEnv && *debugEnv)
|
||||
virLogSetOutputs(debugEnv);
|
||||
|
@ -80,9 +80,10 @@ testLogParseFilters(const void *opaque)
|
||||
{
|
||||
int ret = -1;
|
||||
int nfilters;
|
||||
virLogFilterPtr *filters = NULL;
|
||||
const struct testLogData *data = opaque;
|
||||
|
||||
nfilters = virLogParseAndDefineFilters(data->str);
|
||||
nfilters = virLogParseFilters(data->str, &filters);
|
||||
if (nfilters < 0) {
|
||||
if (!data->pass) {
|
||||
VIR_TEST_DEBUG("Got expected error: %s\n",
|
||||
@ -102,7 +103,7 @@ testLogParseFilters(const void *opaque)
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
virLogReset();
|
||||
virLogFilterListFree(filters, nfilters);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user