From c44ee963f756cdac87e9ab739fc7e43aab70ad2d Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 28 Feb 2010 12:43:02 +0100 Subject: Avoid sending log output to the console on startup By initializing the configuration before starting to log, so that we can take into account the logToStandardOut setting. Reviewed-by: Jared Adams --- src/client.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index 9be7d0df..9fa61364 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -216,18 +216,17 @@ Client::Client(const Options &options): } initHomeDir(); + initConfiguration(); // Configure logger logger->setLogFile(mLocalDataDir + std::string("/mana.log")); + logger->setLogToStandardOut(config.getValue("logToStandardOut", 0)); // Log the mana version logger->log("Mana %s", FULL_VERSION); - initConfiguration(); initScreenshotDir(); - logger->setLogToStandardOut(config.getValue("logToStandardOut", 0)); - // Initialize SDL logger->log("Initializing SDL..."); if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) @@ -1018,7 +1017,6 @@ void Client::initHomeDir() void Client::initConfiguration() { // Fill configuration with defaults - logger->log("Initializing configuration..."); std::string defaultHost = branding.getValue("defaultServer", "server.themanaworld.org"); int defaultPort = (int) branding.getValue("defaultPort", DEFAULT_PORT); -- cgit v1.2.3-70-g09d2