summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-11 23:27:27 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-11 23:27:27 +0000
commit1eae3c2ad42df386967afa42ed13cc95e7a0dd91 (patch)
treeb1bcd519c9f290842eb1637f30b55a1a825fc9e8
parentc1ca268121c9c4d47614c28683a5c4f6bc461092 (diff)
Remove 'default log' and <options:loglevel> (wtf?)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9460 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/configreader.h4
-rw-r--r--src/configreader.cpp24
-rw-r--r--src/helperfuncs.cpp28
-rw-r--r--src/logger.cpp4
4 files changed, 3 insertions, 57 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 3d48759a7..3293aac83 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -490,10 +490,6 @@ class CoreExport ServerConfig : public Extensible
*/
int debugging;
- /** The loglevel in use by the IRC server
- */
- int LogLevel;
-
/** How many seconds to wait before exiting
* the program when /DIE is correctly issued.
*/
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 2b6672ae9..42ee2c655 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -53,7 +53,6 @@ ServerConfig::ServerConfig(InspIRCd* Instance) : ServerInstance(Instance)
debugging = 0;
MaxChans = 20;
OperMaxChans = 30;
- LogLevel = DEFAULT;
maxbans.clear();
DNSServerValidator = &ValidateDnsServer;
}
@@ -368,27 +367,6 @@ bool ValidateMaxWho(ServerConfig* conf, const char*, const char*, ValueItem &dat
return true;
}
-bool ValidateLogLevel(ServerConfig* conf, const char*, const char*, ValueItem &data)
-{
- std::string dbg = data.GetString();
- conf->LogLevel = DEFAULT;
-
- if (dbg == "debug")
- conf->LogLevel = DEBUG;
- else if (dbg == "verbose")
- conf->LogLevel = VERBOSE;
- else if (dbg == "default")
- conf->LogLevel = DEFAULT;
- else if (dbg == "sparse")
- conf->LogLevel = SPARSE;
- else if (dbg == "none")
- conf->LogLevel = NONE;
-
- conf->debugging = (conf->LogLevel == DEBUG);
-
- return true;
-}
-
bool ValidateMotd(ServerConfig* conf, const char*, const char*, ValueItem &data)
{
conf->ReadFile(conf->MOTD, data.GetString());
@@ -753,7 +731,6 @@ void ServerConfig::Read(bool bail, User* user)
{
int rem = 0, add = 0; /* Number of modules added, number of modules removed */
- static char debug[MAXBUF]; /* Temporary buffer for debugging value */
static char maxkeep[MAXBUF]; /* Temporary buffer for WhoWasMaxKeep value */
static char hidemodes[MAXBUF]; /* Modes to not allow listing from users below halfop */
static char exemptchanops[MAXBUF]; /* Exempt channel ops from these modes */
@@ -789,7 +766,6 @@ void ServerConfig::Read(bool bail, User* user)
{"options", "prefixpart", "", new ValueContainerChar (this->PrefixPart), DT_CHARPTR, NoValidation},
{"options", "suffixpart", "", new ValueContainerChar (this->SuffixPart), DT_CHARPTR, NoValidation},
{"options", "fixedpart", "", new ValueContainerChar (this->FixedPart), DT_CHARPTR, NoValidation},
- {"options", "loglevel", "default", new ValueContainerChar (debug), DT_CHARPTR, ValidateLogLevel},
{"options", "netbuffersize","10240", new ValueContainerInt (&this->NetBufferSize), DT_INTEGER, ValidateNetBufferSize},
{"options", "maxwho", "128", new ValueContainerInt (&this->MaxWhoResults), DT_INTEGER, ValidateMaxWho},
{"options", "allowhalfop", "0", new ValueContainerBool (&this->AllowHalfop), DT_BOOLEAN, NoValidation},
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 67faee8f5..d2fbca6f6 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -281,38 +281,12 @@ bool InspIRCd::IsSID(const std::string &str)
/* 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) */
+ /* This function only happens at startup now */
if (Config->nofork)
{
this->Logs->SetupNoFork();
}
- if (!Config->writelog) return true; // Skip opening default log if -nolog
Config->MyDir = Config->GetFullProgDir();
-
- if (!*this->LogFileName)
- {
- if (Config->logpath.empty())
- {
- Config->logpath = Config->MyDir + "/ircd.log";
- }
-
- Config->log_file = fopen(Config->logpath.c_str(),"a+");
- }
- else
- {
- Config->log_file = fopen(this->LogFileName,"a+");
- }
-
- if (!Config->log_file)
- {
- return false;
- }
-
- FileWriter* fw = new FileWriter(this, Config->log_file);
- FileLogStream *f = new FileLogStream(this, (Config->forcedebug ? DEBUG : Config->LogLevel), fw);
-
- this->Logs->AddLogType("*", f, true);
-
return true;
}
diff --git a/src/logger.cpp b/src/logger.cpp
index 8e887830d..c8d7e8b39 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -49,11 +49,11 @@ void LogManager::SetupNoFork()
if (!noforkstream)
{
FileWriter* fw = new FileWriter(ServerInstance, stdout);
- noforkstream = new FileLogStream(ServerInstance, ServerInstance->Config->forcedebug ? DEBUG : ServerInstance->Config->LogLevel, fw);
+ noforkstream = new FileLogStream(ServerInstance, ServerInstance->Config->forcedebug ? DEBUG : DEFAULT, fw);
}
else
{
- noforkstream->ChangeLevel(ServerInstance->Config->forcedebug ? DEBUG : ServerInstance->Config->LogLevel);
+ noforkstream->ChangeLevel(ServerInstance->Config->forcedebug ? DEBUG : DEFAULT);
}
AddLogType("*", noforkstream, false);
}