diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/helperfuncs.cpp | 22 | ||||
-rw-r--r-- | src/inspircd.cpp | 16 |
2 files changed, 3 insertions, 35 deletions
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())) { |