virStringFreeList(strings);
return ret;
}
+
+/**
+ * virLogSetOutputs:
+ * @outputs: string defining a (set of) output(s)
+ *
+ * Replaces the current set of defined outputs with a new set of outputs.
+ *
+ * Returns 0 on success or -1 in case of an error.
+ */
+int
+virLogSetOutputs(const char *src)
+{
+ int ret = -1;
+ int noutputs = 0;
+ virLogOutputPtr *outputs = NULL;
+
+ if (virLogInitialize() < 0)
+ return -1;
+
+ if ((noutputs = virLogParseOutputs(src, &outputs)) < 0)
+ goto cleanup;
+
+ if (virLogDefineOutputs(outputs, noutputs) < 0)
+ goto cleanup;
+
+ outputs = NULL;
+ ret = 0;
+ cleanup:
+ virLogOutputListFree(outputs, noutputs);
+ return ret;
+}
void virLogOutputListFree(virLogOutputPtr *list, int count);
void virLogFilterFree(virLogFilterPtr filter);
void virLogFilterListFree(virLogFilterPtr *list, int count);
+int virLogSetOutputs(const char *outputs) ATTRIBUTE_NONNULL(1);
/*
* Internal logging API