]> Dogcows Code - chaz/yoink/commitdiff
moved log level from configure to setting
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 14 Jan 2010 03:24:07 +0000 (20:24 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Thu, 14 Jan 2010 03:24:07 +0000 (20:24 -0700)
configure.ac
data/yoinkrc
src/MainLayer.cc
src/Moof/Video.cc

index 054c4acf0e2b5b961a9f8566bbe85568239db0c2..b52ea766b8a675162909a7165ac215d94e40f2ac 100644 (file)
@@ -99,12 +99,6 @@ AC_ARG_ENABLE([qt4],
                          [qt4=$enableval],
                          [qt4=no])
 
-AC_ARG_WITH([log-level],
-                       [AS_HELP_STRING([--with-log-level=NUM],
-                                                       [0, none... 1, errors... 4, everything (default: 3)])],
-                       [log_level=$withval],
-                       [log_level=3])
-
 
 if test x$debug = xyes
 then
@@ -151,9 +145,6 @@ then
                          [Define to 1 if you want to use QT4 info/error dialogs.])
 fi
 
-AC_DEFINE_UNQUOTED([YOINK_LOGLEVEL], [$log_level],
-                                  [Define to detail level of logging.])
-
 
 if test "x$prefix" = xNONE
 then
@@ -371,7 +362,6 @@ echo ""
 echo "            Target: $target"
 echo "            Prefix: $prefix"
 echo "    Data Directory: $DATADIR"
-echo "         Log Level: $log_level"
 echo "             Debug: $debug"
 echo "  Double Precision: $double_precision"
 echo "           Profile: $profile"
index d7f97ccd00b798ed714351c20fc3cbd74082dc08..36b6e58d5ea9e9e982fc33ced1e2a65b4edbd140 100644 (file)
@@ -35,12 +35,12 @@ framerate           = 50
 -- Set this to print the current actual framerate to the console each
 -- second.
 
-showfps                        = true
+showfps                        = false
 
 -- Set this to run the game in full-screen mode.  The default behavior is
 -- to run the game in a window.
 
-fullscreen             = true
+fullscreen             = false
 
 -- If the game is running in a window, set this to also make the window
 -- resizable.  This has no effective if the fullscreen option is true.
@@ -53,7 +53,7 @@ resizable             = true
 -- default behavior is to pick a native resolution.  Otherwise, the game
 -- window will default to 800x600.
 
---videomode            = {800, 600}
+videomode              = {800, 600}
 
 -- Set this to make the cursor remain visible as you mouse over the view of
 -- the game.
@@ -71,3 +71,12 @@ doublebuffer = true
 
 swapcontrol            = true
 
+-- Set the level of log detail that will be printed to the console.
+-- Possible values are:
+-- 0 print nothing
+-- 1 errors only
+-- 2 include warnings
+-- 3 print everything, including debug messages
+
+loglevel = 2
+
index 5f097ea9438a5cd8e9bd9cd6b8721b3c0f2e991b..ad2dbbc5f22d9a607f69327783032eee338c4236 100644 (file)
@@ -289,17 +289,6 @@ int main(int argc, char* argv[])
        }
 
 
-#if        YOINK_LOGLEVEL >= 3
-       Mf::Log::setLevel(Mf::Log::INFO);
-#elif  YOINK_LOGLEVEL >= 2
-       Mf::Log::setLevel(Mf::Log::WARNING);
-#elif  YOINK_LOGLEVEL >= 1
-       Mf::Log::setLevel(Mf::Log::ERROR);
-#elif  YOINK_LOGLEVEL
-       Mf::Log::setLevel(Mf::Log::NONE);
-#endif
-
-
        // Add search paths; they should be searched in this order:
        // 1. YOINK_DATADIR (environment)
        // 2. YOINK_DATADIR (configure)
@@ -319,9 +308,7 @@ int main(int argc, char* argv[])
        // 3. $HOME/.yoinkrc
        // 4. YOINKRC (environment)
 
-       std::string configFiles;
-
-       configFiles += Mf::Resource::getPath("yoinkrc");
+       std::string configFiles = Mf::Resource::getPath("yoinkrc");
 #if !defined(_WIN32) && !defined(__WIN32__)
        configFiles += ":/etc/yoinkrc";
 #endif
@@ -337,6 +324,10 @@ int main(int argc, char* argv[])
        Mf::Settings& settings = Mf::Settings::getInstance();
        settings.loadFromFile(configFiles);
        settings.parseArgs(argc, argv);
+
+       Mf::Log::Level logLevel;
+       if (settings.get("loglevel", logLevel)) Mf::Log::setLevel(logLevel);
+
        Mf::engine.initWithSettings(settings);
 
        std::string iconFile = Mf::Resource::getPath(PACKAGE".png");
index ba375e10318195cc770bca37552288d64bb6d816..544e172ad7a00dac196867689e69c8429fd7e0be 100644 (file)
@@ -132,7 +132,7 @@ void Video::setVideoMode(const long mode[3])
                        // on win32, creating a new context via SDL_SetVideoMode will wipe
                        // out the GL state, so we gotta notify everyone to reload their
                        // state after the change
-                       Engine::getInstance().dispatch("video.newcontext");
+                       engine.dispatch("video.newcontext");
 
                        logInfo("video context recreated");
 #endif
This page took 0.028566 seconds and 4 git commands to generate.