diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-09-22 00:13:39 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-09-22 00:13:39 +0200 |
commit | 3b119b08539224b70a0fc7e5807f620dee286cad (patch) | |
tree | 3857846bf3f2fb653f13df386ed6cd8f36c9750d /src/account-server | |
parent | 4b0892691729e5efba27c796e29002b1e1d54166 (diff) | |
download | manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.tar.gz manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.tar.bz2 manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.tar.xz manaserv-3b119b08539224b70a0fc7e5807f620dee286cad.zip |
Added options to disable the server log to standard output to the minimum.
Also made some small cleanups.
Resolves: Mana-Mantis #241
Reviewed-by: Jaxad0127.
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/main-account.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index 0be05abe..23332362 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -148,9 +148,10 @@ static void initialize() // Initialize the logger. Logger::setLogFile(logFile); - // write the messages to both the screen and the log file. - Logger::setTeeMode(true); - + // Write the messages to both the screen and the log file. + Logger::setTeeMode( + Configuration::getBoolValue("log_accountToStandardOutput", + true)); LOG_INFO("Using log file: " << logFile); // Indicate in which file the statistics are put. @@ -336,16 +337,21 @@ static void parseOptions(int argc, char *argv[], CommandLineOptions &options) */ int main(int argc, char *argv[]) { -#ifdef PACKAGE_VERSION - LOG_INFO("The Mana Account+Chat Server v" << PACKAGE_VERSION); -#endif - // Parse command line options CommandLineOptions options; parseOptions(argc, argv, options); initializeConfiguration(options.configPath); + // General initialization + initialize(); + +#ifdef PACKAGE_VERSION + LOG_INFO("The Mana Account+Chat Server v" << PACKAGE_VERSION); +#else + LOG_INFO("The Mana Account+Chat Server (unknown version)"); +#endif + if (!options.verbosityChanged) options.verbosity = static_cast<Logger::Level>( Configuration::getValue("log_accountServerLogLevel", @@ -356,9 +362,6 @@ int main(int argc, char *argv[]) options.port = Configuration::getValue("net_accountServerPort", options.port); - // General initialization - initialize(); - std::string host = Configuration::getValue("net_listenHost", std::string()); if (!AccountClientHandler::initialize(DEFAULT_ATTRIBUTEDB_FILE, options.port, host) || |