+/* Returns as a string current logging patterns for each destination.
+ * This string must be released by caller. */
+char *
+vlog_get_patterns(void)
+{
+ struct ds ds = DS_EMPTY_INITIALIZER;
+ enum vlog_destination destination;
+
+ ovs_rwlock_rdlock(&pattern_rwlock);
+ ds_put_format(&ds, " prefix format\n");
+ ds_put_format(&ds, " ------ ------\n");
+
+ for (destination = 0; destination < VLF_N_DESTINATIONS; destination++) {
+ struct destination *f = &destinations[destination];;
+ const char *prefix = "none";
+
+ if (destination == VLF_SYSLOG && syslogger) {
+ prefix = syslog_get_prefix(syslogger);
+ }
+ ds_put_format(&ds, "%-7s %-32s %s\n", f->name, prefix, f->pattern);
+ }
+ ovs_rwlock_unlock(&pattern_rwlock);
+
+ return ds_cstr(&ds);
+}
+