From 591cfcedfb9c70db5cfa22ac7bece3637a796f77 Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 22 Sep 2003 09:31:36 +0000 Subject: [PATCH] Allow the log-level to be set as early as possible --- src/Main/options.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 58901152b..446bedc8a 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -961,6 +961,23 @@ fgOptLogLevel( const char *arg ) { fgSetString("/sim/logging/classes", "all"); fgSetString("/sim/logging/priority", arg); + + string priority = arg; + if (priority == "bulk") { + logbuf::set_log_priority(SG_BULK); + } else if (priority == "debug") { + logbuf::set_log_priority(SG_DEBUG); + } else if (priority.empty() || priority == "info") { // default + 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_INFO, "Logging priority is " << priority); + return FG_OPTIONS_OK; } -- 2.39.5