X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Flogger.cpp;h=b9f9bae0b7c866795d0382b593524bd7807543ec;hb=f5b2265c2e6868431abbaa301aa1d64e8d49d8b0;hp=e3e95632583b9600cf45d5fbe65ecaa4d65160f9;hpb=c0aba5b728b0a921d95ec120aa638dab1520b42f;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/logger.cpp b/src/logger.cpp index e3e956325..b9f9bae0b 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -50,8 +50,7 @@ */ const char LogStream::LogHeader[] = - "Log started for " INSPIRCD_VERSION " (" MODULE_INIT_STR ")" - " - compiled on " INSPIRCD_SYSTEM; + "Log started for " INSPIRCD_VERSION " (" MODULE_INIT_STR ")"; LogManager::LogManager() : Logging(false) @@ -78,35 +77,35 @@ void LogManager::OpenFileLogs() { ConfigTag* tag = i->second; std::string method = tag->getString("method"); - if (method != "file") + if (!stdalgo::string::equalsci(method, "file")) { continue; } std::string type = tag->getString("type"); std::string level = tag->getString("level"); LogLevel loglevel = LOG_DEFAULT; - if (level == "rawio") + if (stdalgo::string::equalsci(level, "rawio")) { loglevel = LOG_RAWIO; ServerInstance->Config->RawLog = true; } - else if (level == "debug") + else if (stdalgo::string::equalsci(level, "debug")) { loglevel = LOG_DEBUG; } - else if (level == "verbose") + else if (stdalgo::string::equalsci(level, "verbose")) { loglevel = LOG_VERBOSE; } - else if (level == "default") + else if (stdalgo::string::equalsci(level, "default")) { loglevel = LOG_DEFAULT; } - else if (level == "sparse") + else if (stdalgo::string::equalsci(level, "sparse")) { loglevel = LOG_SPARSE; } - else if (level == "none") + else if (stdalgo::string::equalsci(level, "none")) { loglevel = LOG_NONE; } @@ -120,7 +119,7 @@ void LogManager::OpenFileLogs() struct tm *mytime = gmtime(&time); strftime(realtarget, sizeof(realtarget), target.c_str(), mytime); FILE* f = fopen(realtarget, "a"); - fw = new FileWriter(f, static_cast(tag->getInt("flush", 20, 1, INT_MAX))); + fw = new FileWriter(f, tag->getUInt("flush", 20, 1, UINT_MAX)); logmap.insert(std::make_pair(target, fw)); } else