summaryrefslogtreecommitdiff
path: root/src/logger.cpp
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:46:24 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-10-21 23:46:24 +0000
commitdcbb0ae938711cd49df73dc2ff6cd6289aeefb44 (patch)
tree82405b49cdba5a0e0f8819df367c75a5c24e455e /src/logger.cpp
parentd8f98565a8617658f610bc94a5d87266930beee4 (diff)
Move command-line items to CommandLineConf
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11949 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/logger.cpp')
-rw-r--r--src/logger.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/logger.cpp b/src/logger.cpp
index e92762b46..b265a8ea6 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -44,47 +44,18 @@
LogManager::LogManager()
{
- noforkstream = NULL;
Logging = false;
}
LogManager::~LogManager()
{
- if (noforkstream)
- {
- ServerInstance->Logs = this;
- delete noforkstream;
- ServerInstance->Logs = NULL;
- }
-}
-
-void LogManager::SetupNoFork()
-{
- if (!noforkstream)
- {
- FileWriter* fw = new FileWriter(stdout);
- noforkstream = new FileLogStream(ServerInstance->Config->forcedebug ? DEBUG : DEFAULT, fw);
- }
- else
- {
- noforkstream->ChangeLevel(ServerInstance->Config->forcedebug ? DEBUG : DEFAULT);
- }
- AddLogType("*", noforkstream, false);
}
void LogManager::OpenFileLogs()
{
- /* Re-register the nofork stream if necessary. */
- if (ServerInstance->Config->nofork)
- {
- SetupNoFork();
- }
/* Skip rest of logfile opening if we are running -nolog. */
- if (!ServerInstance->Config->writelog)
- {
+ if (!ServerInstance->Config->cmdline.writelog)
return;
- }
- ConfigReader Conf;
std::map<std::string, FileWriter*> logmap;
ConfigTagList tags = ServerInstance->Config->ConfTags("log");
for(ConfigIter i = tags.first; i != tags.second; ++i)
@@ -98,10 +69,9 @@ void LogManager::OpenFileLogs()
std::string type = tag->getString("type");
std::string level = tag->getString("level");
int loglevel = DEFAULT;
- if (level == "debug" || ServerInstance->Config->forcedebug)
+ if (level == "debug")
{
loglevel = DEBUG;
- ServerInstance->Config->debugging = true;
}
else if (level == "verbose")
{