+ for (i = 0; i < LS_LAST_SYSTEM; i++)
+ logDesc[i].mark = 0;
+}
+
+/** Reset unmodified fields in all log subsystems to their defaults.
+ * @param[in] flag If non-zero, clear default syslog facility.
+ */
+int
+log_feature_mark(int flag)
+{
+ int i;
+
+ if (flag)
+ log_set_default(0);
+
+ for (i = 0; i < LS_LAST_SYSTEM; i++) {
+ if (!(logDesc[i].mark & LOG_MARK_FILE)) {
+ if (logDesc[i].subsys != LS_DEBUG) { /* debug is special */
+ if (logDesc[i].file) /* destroy previous entry... */
+ log_file_destroy(logDesc[i].file);
+ logDesc[i].file = 0;
+ }
+ }
+
+ if (!(logDesc[i].mark & LOG_MARK_FACILITY)) /* set default facility */
+ logDesc[i].facility = logDesc[i].def_fac;
+
+ if (!(logDesc[i].mark & LOG_MARK_SNOMASK)) /* set default snomask */
+ logDesc[i].snomask = logDesc[i].def_sno;
+
+ if (!(logDesc[i].mark & LOG_MARK_LEVEL)) /* set default level */
+ logDesc[i].level = L_DEFAULT;
+ }
+
+ return 0; /* we don't have a notify handler */
+}
+
+/** Feature list callback to report log settings.
+ * @param[in] to Client requesting list.
+ * @param[in] flag If non-zero, report default syslog facility.
+ */
+void
+log_feature_report(struct Client *to, int flag)
+{
+ int i;
+
+ for (i = 0; i < LS_LAST_SYSTEM; i++)
+ {
+ if (logDesc[i].mark & LOG_MARK_FILE) /* report file */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F LOG %s FILE %s",
+ logDesc[i].name, (logDesc[i].file && logDesc[i].file->file ?
+ logDesc[i].file->file : "(terminal)"));
+
+ if (logDesc[i].mark & LOG_MARK_FACILITY) /* report facility */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F LOG %s FACILITY %s",
+ logDesc[i].name, log_fac_name(logDesc[i].facility));
+
+ if (logDesc[i].mark & LOG_MARK_SNOMASK) /* report snomask */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F LOG %s SNOMASK %s",
+ logDesc[i].name, log_sno_name(logDesc[i].snomask));
+
+ if (logDesc[i].mark & LOG_MARK_LEVEL) /* report log level */
+ send_reply(to, SND_EXPLICIT | RPL_STATSFLINE, "F LOG %s LEVEL %s",
+ logDesc[i].name, log_lev_name(logDesc[i].level));
+ }