From a19e800b99eba898e25f252514ad4949b79fd872 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Sat, 5 Jun 2010 13:17:35 +0000 Subject: [PATCH] Removed 64-bit warning, and reduced more code duplication --- lib/synergy/CApp.cpp | 11 +++++++++++ lib/synergy/CApp.h | 3 +++ lib/synergy/CClientApp.cpp | 13 +------------ lib/synergy/CServerApp.cpp | 13 +------------ 4 files changed, 16 insertions(+), 24 deletions(-) diff --git a/lib/synergy/CApp.cpp b/lib/synergy/CApp.cpp index 493dd8ef..75f7af68 100644 --- a/lib/synergy/CApp.cpp +++ b/lib/synergy/CApp.cpp @@ -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()))); + } + } +} diff --git a/lib/synergy/CApp.h b/lib/synergy/CApp.h index 4703bf73..91188c65 100644 --- a/lib/synergy/CApp.h +++ b/lib/synergy/CApp.h @@ -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); diff --git a/lib/synergy/CClientApp.cpp b/lib/synergy/CClientApp.cpp index ad1fedc8..da98b82e 100644 --- a/lib/synergy/CClientApp.cpp +++ b/lib/synergy/CClientApp.cpp @@ -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 diff --git a/lib/synergy/CServerApp.cpp b/lib/synergy/CServerApp.cpp index 1998b1f5..a9c7a3dc 100644 --- a/lib/synergy/CServerApp.cpp +++ b/lib/synergy/CServerApp.cpp @@ -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