#include "ircd_defs.h"
#include "logger.h"
#include "s_conf.h"
-#include "sprintf_irc.h"
#include "send.h"
#include "client.h"
#include "s_serv.h"
static FILE *log_foper;
static FILE *log_server;
static FILE *log_kill;
-static FILE *log_gline;
static FILE *log_kline;
static FILE *log_operspy;
static FILE *log_ioerror;
{ &ConfigFileEntry.fname_serverlog, &log_server },
{ &ConfigFileEntry.fname_killlog, &log_kill },
{ &ConfigFileEntry.fname_klinelog, &log_kline },
- { &ConfigFileEntry.fname_glinelog, &log_gline },
{ &ConfigFileEntry.fname_operspylog, &log_operspy },
{ &ConfigFileEntry.fname_ioerrorlog, &log_ioerror }
};
{
int i;
- if(log_main != NULL)
- fclose(log_main);
+ close_logfiles();
log_main = fopen(logFileName, "a");
/* log_main is handled above, so just do the rest */
for(i = 1; i < LAST_LOGFILE; i++)
{
- /* close open logfiles */
+ /* reopen those with paths */
+ if(!EmptyString(*log_table[i].name))
+ *log_table[i].logfile = fopen(*log_table[i].name, "a");
+ }
+}
+
+void
+close_logfiles(void)
+{
+ int i;
+
+ if(log_main != NULL)
+ fclose(log_main);
+
+ /* log_main is handled above, so just do the rest */
+ for(i = 1; i < LAST_LOGFILE; i++)
+ {
if(*log_table[i].logfile != NULL)
{
fclose(*log_table[i].logfile);
*log_table[i].logfile = NULL;
}
-
- /* reopen those with paths */
- if(!EmptyString(*log_table[i].name))
- *log_table[i].logfile = fopen(*log_table[i].name, "a");
}
-}
+}
void
ilog(ilogfile dest, const char *format, ...)