* +------------------------------------+
*
* InspIRCd: (C) 2002-2009 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
+ * See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
* the file COPYING for details.
void FileWriter::WriteLogLine(const std::string &line)
{
- if (log)
+ if (log == NULL)
+ return;
+// XXX: For now, just return. Don't throw an exception. It'd be nice to find out if this is happening, but I'm terrified of breaking so close to final release. -- w00t
+// throw CoreException("FileWriter::WriteLogLine called with a closed logfile");
+
+ fprintf(log,"%s",line.c_str());
+ if (writeops++ % 20)
{
- fprintf(log,"%s",line.c_str());
- if (writeops++ % 20)
- {
- fflush(log);
- }
+ fflush(log);
}
}
{
fflush(log);
fclose(log);
+ log = NULL;
}
}
FileWriter::~FileWriter()
{
+ this->Close();
}