]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove 'default log' and <options:loglevel> (wtf?)
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 11 Apr 2008 23:27:27 +0000 (23:27 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 11 Apr 2008 23:27:27 +0000 (23:27 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9460 e03df62e-2008-0410-955e-edbf42e46eb7

include/configreader.h
src/configreader.cpp
src/helperfuncs.cpp
src/logger.cpp

index 3d48759a7cdb216c29d10482579bd28595fe417a..3293aac83544ea04fda81c4e87c6813b4fad7cd7 100644 (file)
@@ -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.
         */
index 2b6672ae9d33f425c6567ab986cefeec9f642666..42ee2c655420eba1324f2a8f54c467f227a6c1c1 100644 (file)
@@ -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},
index 67faee8f54371fd77dc814cf56c5c8e79ac413ab..d2fbca6f6421fb2809a45f686ad51260804f7d68 100644 (file)
@@ -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;
 }
 
index 8e887830db0c10c8d97790f89e9b784482436a3f..c8d7e8b398de350e03c1f29e57e8c973f9c2089a 100644 (file)
@@ -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);
 }