Removed 64-bit warning, and reduced more code duplication

This commit is contained in:
Nick Bolton 2010-06-05 13:17:35 +00:00
parent 028142bee9
commit a19e800b99
4 changed files with 16 additions and 24 deletions

View File

@ -307,3 +307,14 @@ CApp::setupFileLogging()
LOG((CLOG_DEBUG1 "logging to file (%s) enabled", argsBase().m_logFile));
}
}
void
CApp::loggingFilterWarning()
{
if (CLOG->getFilter() > CLOG->getConsoleMaxLevel()) {
if (argsBase().m_logFile == NULL) {
LOG((CLOG_WARN "log messages above %s are NOT sent to console (use file logging)",
CLOG->getFilterName(CLOG->getConsoleMaxLevel())));
}
}
}

View File

@ -94,6 +94,9 @@ public:
// If --log was specified in args, then add a file logger.
void setupFileLogging();
// If messages will be hidden (to improve performance), warn user.
void loggingFilterWarning();
protected:
virtual void parseArgs(int argc, const char* const* argv, int &i);
virtual bool parseArg(const int& argc, const char* const* argv, int& i);

View File

@ -146,18 +146,7 @@ CClientApp::parseArgs(int argc, const char* const* argv)
// identify system
LOG((CLOG_INFO "%s Client on %s %s", kAppVersion, ARCH->getOSName().c_str(), ARCH->getPlatformName().c_str()));
#ifdef WIN32
#ifdef _AMD64_
LOG((CLOG_WARN "This is an experimental x64 build of %s. Use it at your own risk.", kApplication));
#endif
#endif
if (CLOG->getFilter() > CLOG->getConsoleMaxLevel()) {
if (args().m_logFile == NULL) {
LOG((CLOG_WARN "log messages above %s are NOT sent to console (use file logging)",
CLOG->getFilterName(CLOG->getConsoleMaxLevel())));
}
}
loggingFilterWarning();
}
void

View File

@ -138,18 +138,7 @@ CServerApp::parseArgs(int argc, const char* const* argv)
// identify system
LOG((CLOG_INFO "%s Server on %s %s", kAppVersion, ARCH->getOSName().c_str(), ARCH->getPlatformName().c_str()));
#ifdef WIN32
#ifdef _AMD64_
LOG((CLOG_WARN "This is an experimental x64 build of %s. Use it at your own risk.", kApplication));
#endif
#endif
if (CLOG->getFilter() > CLOG->getConsoleMaxLevel()) {
if (args().m_logFile == NULL) {
LOG((CLOG_WARN "log messages above %s are NOT sent to console (use file logging)",
CLOG->getFilterName(CLOG->getConsoleMaxLevel())));
}
}
loggingFilterWarning();
}
void