summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel De Graaf <danieldg@inspircd.org>2010-05-08 14:25:00 -0500
committerDaniel De Graaf <danieldg@inspircd.org>2010-05-08 14:25:00 -0500
commitf3dc5572200b4bce6b09448ac4660e2d889cb038 (patch)
tree0c837c935653aa6f8609bbc0fcced8b842c30f47 /src
parentcb4c516ace8fef75b8a54a141c3644af9697ac0a (diff)
Change -debug to force RAWIO level logging and disable all other logs
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp2
-rw-r--r--src/logger.cpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index c6faf8802..b4a013e50 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -457,7 +457,7 @@ InspIRCd::InspIRCd(int argc, char** argv) :
if (do_debug)
{
FileWriter* fw = new FileWriter(stdout);
- FileLogStream* fls = new FileLogStream(DEBUG, fw);
+ FileLogStream* fls = new FileLogStream(RAWIO, fw);
Logs->AddLogTypes("*", fls, true);
}
else if (!this->OpenLog(argv, argc))
diff --git a/src/logger.cpp b/src/logger.cpp
index 2e3f556c6..41363b414 100644
--- a/src/logger.cpp
+++ b/src/logger.cpp
@@ -53,6 +53,11 @@ LogManager::~LogManager()
void LogManager::OpenFileLogs()
{
+ if (Config->cmdline.forcedebug)
+ {
+ ServerInstance->Config->RawLog = true;
+ return;
+ }
/* Skip rest of logfile opening if we are running -nolog. */
if (!ServerInstance->Config->cmdline.writelog)
return;
@@ -119,6 +124,8 @@ void LogManager::OpenFileLogs()
void LogManager::CloseLogs()
{
+ if (Config->cmdline.forcedebug)
+ return;
std::map<std::string, std::vector<LogStream*> >().swap(LogStreams); /* Clear it */
std::map<LogStream*, std::vector<std::string> >().swap(GlobalLogStreams); /* Clear it */
for (std::map<LogStream*, int>::iterator i = AllLogStreams.begin(); i != AllLogStreams.end(); ++i)