using std::cerr;
using std::endl;
using std::vector;
+using std::cin;
#define NEW_DEFAULT_MODEL_HZ 120
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 )
{"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 },
{"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 },
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
}