]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/options.cxx
properly add librt when clock_gettime is used
[flightgear.git] / src / Main / options.cxx
index 5bd6820e6e9db435c6ddfa2acec0cc5726863287..d717666718518feed50c3106a8679747de6093ce 100644 (file)
@@ -80,6 +80,7 @@ using std::cout;
 using std::cerr;
 using std::endl;
 using std::vector;
+using std::cin;
 
 #define NEW_DEFAULT_MODEL_HZ 120
 
@@ -899,29 +900,20 @@ fgOptTraceRead( const char *arg )
 static int
 fgOptLogLevel( const char *arg )
 {
-    fgSetString("/sim/logging/classes", "all");
     fgSetString("/sim/logging/priority", arg);
-
-    string priority = arg;
-    logbuf::set_log_classes(SG_ALL);
-    if (priority == "bulk") {
-      logbuf::set_log_priority(SG_BULK);
-    } else if (priority == "debug") {
-      logbuf::set_log_priority(SG_DEBUG);
-    } else if (priority == "info") {
-      logbuf::set_log_priority(SG_INFO);
-    } else if (priority == "warn") {
-      logbuf::set_log_priority(SG_WARN);
-    } else if (priority == "alert") {
-      logbuf::set_log_priority(SG_ALERT);
-    } else {
-      SG_LOG(SG_GENERAL, SG_WARN, "Unknown logging priority " << priority);
-    }
-    SG_LOG(SG_GENERAL, SG_DEBUG, "Logging priority is " << priority);
+    setLoggingPriority(arg);
 
     return FG_OPTIONS_OK;
 }
 
+static int
+fgOptLogClasses( const char *arg )
+{
+    fgSetString("/sim/logging/classes", arg);
+    setLoggingClasses (arg);
+
+    return FG_OPTIONS_OK;
+}
 
 static int
 fgOptTraceWrite( const char *arg )
@@ -1465,7 +1457,7 @@ struct OptionDesc {
     {"hud-tris",                     false, OPTION_STRING, "/sim/hud/frame-stat-type", false, "tris", 0 },
     {"hud-culled",                   false, OPTION_STRING, "/sim/hud/frame-stat-type", false, "culled", 0 },
     {"atcsim",                       true,  OPTION_CHANNEL, "", false, "dummy", 0 },
-    {"atlas",                        true,  OPTION_CHANNEL, "", false, "", 0 },
+    {"atlas",                        true,  OPTION_CHANNEL | OPTION_MULTI, "", false, "", 0 },
     {"httpd",                        true,  OPTION_CHANNEL, "", false, "", 0 },
 #ifdef FG_JPEG_SERVER
     {"jpg-httpd",                    true,  OPTION_CHANNEL, "", false, "", 0 },
@@ -1498,6 +1490,7 @@ struct OptionDesc {
     {"trace-read",                   true,  OPTION_FUNC | OPTION_MULTI,   "", false, "", fgOptTraceRead },
     {"trace-write",                  true,  OPTION_FUNC | OPTION_MULTI,   "", false, "", fgOptTraceWrite },
     {"log-level",                    true,  OPTION_FUNC,   "", false, "", fgOptLogLevel },
+    {"log-class",                    true,  OPTION_FUNC,   "", false, "", fgOptLogClasses },
     {"view-offset",                  true,  OPTION_FUNC | OPTION_MULTI,   "", false, "", fgOptViewOffset },
     {"visibility",                   true,  OPTION_FUNC,   "", false, "", fgOptVisibilityMeters },
     {"visibility-miles",             true,  OPTION_FUNC,   "", false, "", fgOptVisibilityMiles },
@@ -2189,8 +2182,8 @@ void Options::showUsage() const
     cout << "For a complete list of options use --help --verbose" << endl;
   }
 #ifdef _MSC_VER
-  cout << "Hit a key to continue..." << endl;
-  cin.get();
+  std::cout << "Hit a key to continue..." << std::endl;
+  std::cin.get();
 #endif
 }