summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/helperfuncs.cpp15
-rw-r--r--src/inspircd.cpp15
-rw-r--r--src/inspircd_io.cpp6
3 files changed, 22 insertions, 14 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 034976fb7..46a85da2c 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -77,7 +77,8 @@ void log(int level, char *text, ...)
va_list argsPtr;
char textbuffer[MAXBUF];
- if (level < Config->LogLevel)
+ /* If we were given -debug we output all messages, regardless of configured loglevel */
+ if ((level < Config->LogLevel) && !Config->forcedebug)
return;
if (TIME != LAST)
@@ -95,13 +96,13 @@ void log(int level, char *text, ...)
vsnprintf(textbuffer, MAXBUF, text, argsPtr);
va_end(argsPtr);
- if (Config->log_file)
+ if (Config->writelog)
fprintf(Config->log_file,"%s %s\n",TIMESTR,textbuffer);
-
- if (Config->nofork)
- {
- printf("%s %s\n", TIMESTR, textbuffer);
- }
+ }
+
+ if (Config->nofork)
+ {
+ printf("%s %s\n", TIMESTR, textbuffer);
}
}
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 5d77e6d75..79a6f1976 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -171,15 +171,23 @@ InspIRCd::InspIRCd(int argc, char** argv)
{
Config->nofork = true;
}
- if (!strcmp(argv[i],"-wait"))
+ else if(!strcmp(argv[i],"-debug"))
+ {
+ Config->forcedebug = true;
+ }
+ else if(!strcmp(argv[i],"-nolog"))
+ {
+ Config->writelog = false;
+ }
+ else if (!strcmp(argv[i],"-wait"))
{
sleep(6);
}
- if (!strcmp(argv[i],"-nolimit"))
+ else if (!strcmp(argv[i],"-nolimit"))
{
printf("WARNING: The `-nolimit' option is deprecated, and now on by default. This behaviour may change in the future.\n");
}
- if (!strcmp(argv[i],"-logfile"))
+ else if (!strcmp(argv[i],"-logfile"))
{
if (argc > i+1)
{
@@ -867,4 +875,3 @@ int main(int argc, char** argv)
}
return 0;
}
-
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 9753e182e..ddad3d388 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -52,8 +52,8 @@ ServerConfig::ServerConfig()
*CustomVersion = *motd = *rules = *PrefixQuit = *DieValue = *DNSServer = '\0';
*OperOnlyStats = *ModPath = *MyExecutable = *DisabledCommands = *PID = '\0';
log_file = NULL;
- OperSpyWhois = nofork = HideBans = HideSplits = false;
- AllowHalfop = true;
+ forcedebug = OperSpyWhois = nofork = HideBans = HideSplits = false;
+ writelog = AllowHalfop = true;
dns_timeout = DieDelay = 5;
MaxTargets = 20;
NetBufferSize = 10240;
@@ -1320,7 +1320,7 @@ bool ServerConfig::ConfValueBool(ConfigDataHash &target, const std::string &tag,
int ServerConfig::ConfValueEnum(ConfigDataHash &target, const char* tag)
{
- return ConfValueEnum(target, std::string(tag));
+ return target.count(tag);
}
int ServerConfig::ConfValueEnum(ConfigDataHash &target, const std::string &tag)