[PATCH REPOST 07/38] virlog: Introduce virLogSetOutputs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This API is the entry point to output modification of the logger. Currently,
everything is done by virLogParseOutputs which should do parsing only and
a separate method which will do the definition part should be added.
---
 src/libvirt_private.syms |  1 +
 src/util/virlog.c        | 23 +++++++++++++++++++++++
 src/util/virlog.h        |  1 +
 3 files changed, 25 insertions(+)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 65fafeb..dafcb6c 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1802,6 +1802,7 @@ virLogReset;
 virLogSetDefaultPriority;
 virLogSetFilters;
 virLogSetFromEnv;
+virLogSetOutputs;
 virLogUnlock;
 virLogVMessage;
 
diff --git a/src/util/virlog.c b/src/util/virlog.c
index 0aa722d..2cd3773 100644
--- a/src/util/virlog.c
+++ b/src/util/virlog.c
@@ -1516,3 +1516,26 @@ virLogSetFilters(const char *filters)
 
     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 the number of outputs successfully defined or -1 in case of an
+ * error.
+ */
+int
+virLogSetOutputs(const char *outputs)
+{
+    int ret = -1;
+
+    if (virLogInitialize() < 0)
+        return -1;
+
+    ret = virLogParseOutputs(outputs);
+
+    return ret;
+}
diff --git a/src/util/virlog.h b/src/util/virlog.h
index 4d7cc98..4141ecd 100644
--- a/src/util/virlog.h
+++ b/src/util/virlog.h
@@ -184,6 +184,7 @@ extern virLogPriority virLogGetDefaultPriority(void);
 extern int virLogSetDefaultPriority(virLogPriority priority);
 extern void virLogSetFromEnv(void);
 extern int virLogSetFilters(const char *filters);
+extern int virLogSetOutputs(const char *outputs);
 extern int virLogDefineFilter(const char *match,
                               virLogPriority priority,
                               unsigned int flags);
-- 
2.4.11

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]