void InspIRCd::Log(int level, const std::string &text)
{
- this->Logs->Log("WARNING", DEFAULT, "Deprecated call to InspIRCd::Log()! - log message follows");
- this->Logs->Log("DEPRECATED", level, text);
+ this->Logs->Log("DEPRECATED", level, "Deprecated use of InspIRCd::Log(), message = %s", text.c_str());
}
std::string InspIRCd::GetServerDescription(const char* servername)
/* open the proper logfile */
bool InspIRCd::OpenLog(char**, int)
{
+ /* This function only happens at startup now (log reopening is done at OnReadConfig stage now instead of rehash) */
+ if (Config->nofork)
+ {
+ this->Logs->SetupNoFork();
+ }
+ if (!Config->writelog) return true; // Skip opening default log if -nolog
Config->MyDir = Config->GetFullProgDir();
if (!*this->LogFileName)
}
FileWriter* fw = new FileWriter(this, Config->log_file);
- FileLogStream *f = new FileLogStream(this, Config->LogLevel, fw);
+ FileLogStream *f = new FileLogStream(this, (Config->forcedebug ? DEBUG : Config->LogLevel), fw);
+
+ this->Logs->AddLogType("*", f, true);
- this->Logs->AddLogType("*", f);
return true;
}
if (geteuid() == 0)
{
printf("WARNING!!! You are running an irc server as ROOT!!! DO NOT DO THIS!!!\n\n");
- this->Log(DEFAULT,"Cant start as root");
+ this->Logs->Log("STARTUP",DEFAULT,"Cant start as root");
Exit(EXIT_STATUS_ROOT);
}
}
if (*Config->DieValue)
{
printf("WARNING: %s\n\n",Config->DieValue);
- this->Log(DEFAULT,"Died because of <die> tag: %s",Config->DieValue);
+ this->Logs->Log("CONFIG",DEFAULT,"Died because of <die> tag: %s",Config->DieValue);
Exit(EXIT_STATUS_DIETAG);
}
}