summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-26 11:05:34 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-02-26 11:05:34 +0000
commit05008506691249a1fb7d3d46651a5e8610a17a48 (patch)
tree6ceae5520ef27cdbbb545435d5537c436505d672 /src/inspircd.cpp
parent30084fbe7eaa1269aa052d16eea8ddabbc820d94 (diff)
Added ability to provide -logfile parameter on commandline
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3327 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index ee30ba4e9..aa40638e2 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -70,6 +70,7 @@ std::vector<InspSocket*> module_sockets;
std::vector<userrec*> local_users;
extern int MODCOUNT;
+extern char LOG_FILE[MAXBUF];
int openSockfd[MAXSOCKS];
sockaddr_in client,server;
socklen_t length;
@@ -171,6 +172,7 @@ InspIRCd::InspIRCd(int argc, char** argv)
printf("ERROR: Your config file is missing, this IRCd will self destruct in 10 seconds!\n");
Exit(ERROR);
}
+ *LOG_FILE = 0;
if (argc > 1) {
for (int i = 1; i < argc; i++)
{
@@ -183,6 +185,18 @@ InspIRCd::InspIRCd(int argc, char** argv)
if (!strcmp(argv[i],"-nolimit")) {
Config->unlimitcore = true;
}
+ if (!strcmp(argv[i],"-logfile")) {
+ if (argc > i)
+ {
+ strlcpy(LOG_FILE,argv[i+1],MAXBUF);
+ printf("LOG: Setting logfile to %s",LOG_FILE);
+ }
+ else
+ {
+ printf("ERROR: The -logfile parameter must be followed by a log file name and path.\n");
+ Exit(ERROR);
+ }
+ }
}
}