return true;
}
+/**
+ * Built-in command: set log level (0 ... 7)
+ */
+static bool
+do_log_level (const SGPropertyNode * arg)
+{
+ sglog().setLogLevels( SG_ALL, (sgDebugPriority)arg->getIntValue() );
+
+ return true;
+}
+
+
\f
////////////////////////////////////////////////////////////////////////
{ "dialog-update", do_dialog_update },
{ "dialog-apply", do_dialog_apply },
{ "presets-commit", do_presets_commit },
+ { "log-level", do_log_level },
{ 0, 0 } // zero-terminated
};
SGTimeStamp last_time_stamp;
SGTimeStamp current_time_stamp;
+
void fgBuildRenderStates( void ) {
default_state = new ssgSimpleState;
default_state->ref();
SGTime *t = globals->get_time_params();
+ sglog().setLogLevels( SG_ALL, (sgDebugPriority)fgGetInt("/sim/log-level") );
+
FGLocation * acmodel_location = 0;
if(cur_fdm_state->getACModel() != 0) {
acmodel_location = (FGLocation *) cur_fdm_state->getACModel()->get3DModel()->getFGLocation();
#endif
// set default log levels
- sglog().setLogLevels( SG_ALL, SG_INFO );
+ sglog().setLogLevels( SG_ALL, SG_WARN );
string version;
#ifdef FLIGHTGEAR_VERSION
#include <simgear/compiler.h>
#include <simgear/misc/exception.hxx>
+#include <simgear/debug/logstream.hxx>
#include <math.h> // rint()
#include <stdio.h>
#else
fgSetString("/sim/startup/browser-app", "webrun.bat");
#endif
+ fgSetInt("/sim/log-level", SG_WARN);
+
// Features
fgSetBool("/sim/hud/visibility", false);
fgSetBool("/sim/panel/visibility", true);
return FG_OPTIONS_OK;
}
+static int
+fgOptDebugLevel( const char *arg )
+{
+ fgSetInt( "/sim/log-level", atoi( arg ) );
+ return FG_OPTIONS_OK;
+}
+
static int
fgOptViewOffset( const char *arg )
{
#endif
{"trace-read", true, OPTION_FUNC, "", false, "", fgOptTraceRead },
{"trace-write", true, OPTION_FUNC, "", false, "", fgOptTraceWrite },
+ {"log-level", true, OPTION_FUNC, "", false, "", fgOptDebugLevel },
{"view-offset", true, OPTION_FUNC, "", false, "", fgOptViewOffset },
{"visibility", true, OPTION_DOUBLE, "/environment/visibility-m", false, "", 0 },
{"visibility-miles", true, OPTION_FUNC, "", false, "", fgOptVisibilityMiles },
SG_LOG(SG_GENERAL, SG_INFO, "Tracing writes for property " << name);
fgGetNode(name.c_str(), true)
->setAttribute(SGPropertyNode::TRACE_WRITE, true);
+ } else if ( arg.find("--log-level=") == 0) {
+ int level = atoi(arg.substr(14));
+ sglog().setLogLevels( SG_ALL, level );
} else if ( arg.find( "--view-offset=" ) == 0 ) {
// $$$ begin - added VS Renganathan, 14 Oct 2K
// for multi-window outside window imagery