summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/configreader.h2
-rw-r--r--include/inspircd.h7
-rw-r--r--src/helperfuncs.cpp22
-rw-r--r--src/inspircd.cpp16
4 files changed, 3 insertions, 44 deletions
diff --git a/include/configreader.h b/include/configreader.h
index cf5dd1a3e..70f81371f 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -142,8 +142,6 @@ struct CommandLineConf
/** Saved argv from startup
*/
char** argv;
-
- std::string startup_log;
};
class CoreExport OperInfo : public refcountbase
diff --git a/include/inspircd.h b/include/inspircd.h
index b55c4c014..f3208dec2 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -492,13 +492,6 @@ class CoreExport InspIRCd
*/
void CheckRoot();
- /** Determine the right path for, and open, the logfile
- * @param argv The argv passed to main() initially, used to calculate program path
- * @param argc The argc passed to main() initially, used to calculate program path
- * @return True if the log could be opened, false if otherwise
- */
- bool OpenLog(char** argv, int argc);
-
/** Return true if a channel name is valid
* @param chname A channel name to verify
* @return True if the name is valid
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index d11a13aa0..ab2ed5682 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -325,28 +325,6 @@ bool InspIRCd::IsSID(const std::string &str)
((str[2] >= 'A' && str[2] <= 'Z') || isdigit(str[2])));
}
-/* open the proper logfile */
-bool InspIRCd::OpenLog(char**, int)
-{
- if (!Config->cmdline.writelog) return true; // Skip opening default log if -nolog
-
- if (Config->cmdline.startup_log.empty())
- Config->cmdline.startup_log = LOG_PATH "/startup.log";
- FILE* startup = fopen(Config->cmdline.startup_log.c_str(), "a+");
-
- if (!startup)
- {
- return false;
- }
-
- FileWriter* fw = new FileWriter(startup);
- FileLogStream *f = new FileLogStream((Config->cmdline.forcedebug ? LOG_DEBUG : LOG_DEFAULT), fw);
-
- this->Logs->AddLogType("*", f, true);
-
- return true;
-}
-
void InspIRCd::CheckRoot()
{
#ifndef _WIN32
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 67cf8707b..659bb31a1 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -364,7 +364,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
struct option longopts[] =
{
{ "nofork", no_argument, &do_nofork, 1 },
- { "logfile", required_argument, NULL, 'f' },
{ "config", required_argument, NULL, 'c' },
{ "debug", no_argument, &do_debug, 1 },
{ "nolog", no_argument, &do_nolog, 1 },
@@ -375,14 +374,10 @@ InspIRCd::InspIRCd(int argc, char** argv) :
};
int index;
- while ((c = getopt_long(argc, argv, ":c:f:", longopts, &index)) != -1)
+ while ((c = getopt_long(argc, argv, ":c:", longopts, &index)) != -1)
{
switch (c)
{
- case 'f':
- /* Log filename was set */
- Config->cmdline.startup_log = optarg;
- break;
case 'c':
/* Config filename was set */
ConfigFileName = optarg;
@@ -395,8 +390,8 @@ InspIRCd::InspIRCd(int argc, char** argv) :
default:
/* Fall through to handle other weird values too */
std::cout << "Unknown parameter '" << argv[optind-1] << "'" << std::endl;
- std::cout << "Usage: " << argv[0] << " [--nofork] [--nolog] [--debug] [--logfile <filename>] " << std::endl <<
- std::string(static_cast<int>(8+strlen(argv[0])), ' ') << "[--runasroot] [--version] [--config <config>] [--testsuite]" << std::endl;
+ std::cout << "Usage: " << argv[0] << " [--nofork] [--nolog] [--debug] [--config <config>]" << std::endl <<
+ std::string(static_cast<int>(8+strlen(argv[0])), ' ') << "[--runasroot] [--version] [--testsuite]" << std::endl;
Exit(EXIT_STATUS_ARGV);
break;
}
@@ -429,11 +424,6 @@ InspIRCd::InspIRCd(int argc, char** argv) :
FileLogStream* fls = new FileLogStream(LOG_RAWIO, fw);
Logs->AddLogTypes("*", fls, true);
}
- else if (!this->OpenLog(argv, argc))
- {
- std::cout << "ERROR: Could not open initial logfile " << Config->cmdline.startup_log << ": " << strerror(errno) << std::endl << std::endl;
- Exit(EXIT_STATUS_LOG);
- }
if (!ServerConfig::FileExists(ConfigFileName.c_str()))
{