From 7d6cafba6e14ac8d18668ad89c6c4b0501228624 Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 22 Sep 2003 09:22:05 +0000 Subject: [PATCH] Use the log level environment already set up by David instead of mine --- src/Main/main.cxx | 2 -- src/Main/options.cxx | 13 +++++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index f2de09b4f..54c619d28 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1025,8 +1025,6 @@ static void fgMainLoop( void ) { SGTime *t = globals->get_time_params(); - sglog().setLogLevels( SG_ALL, (sgDebugPriority)fgGetInt("/sim/log-level") ); - SGLocation * acmodel_location = 0; if(cur_fdm_state->getACModel() != 0) { acmodel_location = (SGLocation *) cur_fdm_state->getACModel()->get3DModel()->getSGLocation(); diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 4f20adf11..58901152b 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -181,7 +181,7 @@ fgSetDefaults () #else fgSetString("/sim/startup/browser-app", "webrun.bat"); #endif - fgSetInt("/sim/log-level", SG_WARN); + fgSetString("/sim/logging/priority", "warn"); // Features fgSetBool("/sim/hud/antialiased", false); @@ -956,6 +956,15 @@ fgOptTraceRead( const char *arg ) return FG_OPTIONS_OK; } +static int +fgOptLogLevel( const char *arg ) +{ + fgSetString("/sim/logging/classes", "all"); + fgSetString("/sim/logging/priority", arg); + return FG_OPTIONS_OK; +} + + static int fgOptTraceWrite( const char *arg ) { @@ -1352,7 +1361,7 @@ struct OptionDesc { #endif {"trace-read", true, OPTION_FUNC, "", false, "", fgOptTraceRead }, {"trace-write", true, OPTION_FUNC, "", false, "", fgOptTraceWrite }, - {"log-level", true, OPTION_INT, "/sim/log-level", false, "", 0 }, + {"log-level", true, OPTION_FUNC, "", false, "", fgOptLogLevel }, {"view-offset", true, OPTION_FUNC, "", false, "", fgOptViewOffset }, {"visibility", true, OPTION_FUNC, "", false, "", fgOptVisibilityMeters }, {"visibility-miles", true, OPTION_FUNC, "", false, "", fgOptVisibilityMiles },