Browse Source

faux/log indent friendly

Peter K 4 years ago
parent
commit
7923ccb957
1 changed files with 26 additions and 23 deletions
  1. 26 23
      faux/log/log.c

+ 26 - 23
faux/log/log.c

@@ -12,35 +12,37 @@
 #include "faux/str.h"
 #include "faux/log.h"
 
-static struct {
+struct log_name {
 	const char *name;
 	int facility;
-} log_names[] = {
-	{ "local0", LOG_LOCAL0 },
-	{ "local1", LOG_LOCAL1 },
-	{ "local2", LOG_LOCAL2 },
-	{ "local3", LOG_LOCAL3 },
-	{ "local4", LOG_LOCAL4 },
-	{ "local5", LOG_LOCAL5 },
-	{ "local6", LOG_LOCAL6 },
-	{ "local7", LOG_LOCAL7 },
-	{ "auth", LOG_AUTH },
+};
+
+static struct log_name log_names[] = {
+	{"local0", LOG_LOCAL0},
+	{"local1", LOG_LOCAL1},
+	{"local2", LOG_LOCAL2},
+	{"local3", LOG_LOCAL3},
+	{"local4", LOG_LOCAL4},
+	{"local5", LOG_LOCAL5},
+	{"local6", LOG_LOCAL6},
+	{"local7", LOG_LOCAL7},
+	{"auth", LOG_AUTH},
 #ifdef LOG_AUTHPRIV
-	{ "authpriv", LOG_AUTHPRIV },
+	{"authpriv", LOG_AUTHPRIV},
 #endif
-	{ "cron", LOG_CRON },
-	{ "daemon", LOG_DAEMON },
+	{"cron", LOG_CRON},
+	{"daemon", LOG_DAEMON},
 #ifdef LOG_FTP
-	{ "ftp", LOG_FTP },
+	{"ftp", LOG_FTP},
 #endif
-	{ "kern", LOG_KERN },
-	{ "lpr", LOG_LPR },
-	{ "mail", LOG_MAIL },
-	{ "news", LOG_NEWS },
-	{ "syslog", LOG_SYSLOG },
-	{ "user", LOG_USER },
-	{ "uucp", LOG_UUCP },
-	{ NULL, 0 }, // end of list
+	{"kern", LOG_KERN},
+	{"lpr", LOG_LPR},
+	{"mail", LOG_MAIL},
+	{"news", LOG_NEWS},
+	{"syslog", LOG_SYSLOG},
+	{"user", LOG_USER},
+	{"uucp", LOG_UUCP},
+	{NULL, 0},		// end of list
 };
 
 /** @brief Parses syslog facility string and returns the facility id.
@@ -55,6 +57,7 @@ static struct {
 int faux_log_facility(const char *str, int *facility) {
 
 	int i;
+
 	assert(facility);
 	assert(str);
 	if (!str || !facility)