new server commandline parameter to choose syslog facility

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4149 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2009-01-26 14:00:47 +00:00
parent c902e8166e
commit 0b2df7317c
4 changed files with 13 additions and 9 deletions
+5 -3
View File
@@ -103,15 +103,17 @@ struct posixsyslog : log
}
};
struct log *newlogger(const char *identity)
struct log *newlogger(const char *identity, int facility)
{
const int facilities[] = { LOG_LOCAL0, LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6, LOG_LOCAL7 };
facility &= 7;
s_sprintfd(id)("AssaultCube %s", identity);
return new posixsyslog(LOG_LOCAL6, id);
return new posixsyslog(facilities[facility], id);
}
#else
struct log *newlogger(const char *identity)
struct log *newlogger(const char *identity, int facility)
{
s_sprintfd(file)("serverlog_%s.txt", identity);
return new filelog(file);