From: ThorstenB Date: Thu, 11 Aug 2011 22:09:26 +0000 (+0200) Subject: Use some more logging class variety. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e9a9f8c96d2963f28e4ecb4eaa91e47b52aaecf6;p=flightgear.git Use some more logging class variety. Stop using SG_GENERAL and SG_ALL everywhere. Using different classes makes switching the classes really useful... --- diff --git a/src/Environment/atmosphere.cxx b/src/Environment/atmosphere.cxx index b7e7be951..022ea540e 100644 --- a/src/Environment/atmosphere.cxx +++ b/src/Environment/atmosphere.cxx @@ -108,7 +108,7 @@ pair PT_vs_hpt( } // Should never get here. - SG_LOG(SG_GENERAL, SG_ALERT, "PT_vs_hpt: ran out of layers for h=" << hh ); + SG_LOG(SG_ENVIRONMENT, SG_ALERT, "PT_vs_hpt: ran out of layers for h=" << hh ); return make_pair(d0, d0); } @@ -250,7 +250,7 @@ double FGAtmo::QNH(const double field_elev, const double field_press) { double rslt = field_press * pow(1. + ISA::lam0 * field_elev / ISA::T0 * prat, 1./nn); #if 0 - SG_LOG(SG_GENERAL, SG_ALERT, "QNH: elev: " << field_elev + SG_LOG(SG_ENVIRONMENT, SG_ALERT, "QNH: elev: " << field_elev << " press: " << field_press << " prat: " << prat << " rslt: " << rslt diff --git a/src/Environment/environment.cxx b/src/Environment/environment.cxx index 4e245554b..e927c3503 100644 --- a/src/Environment/environment.cxx +++ b/src/Environment/environment.cxx @@ -678,13 +678,13 @@ FGEnvironment::_recalc_sl_temperature () #if 0 { - SG_LOG(SG_GENERAL, SG_DEBUG, "recalc_sl_temperature: using " + SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "recalc_sl_temperature: using " << temperature_degc << " @ " << elevation_ft << " :: " << this); } #endif if (elevation_ft * atmodel::foot >= ISA_def[1].height) { - SG_LOG(SG_GENERAL, SG_ALERT, "recalc_sl_temperature: " + SG_LOG(SG_ENVIRONMENT, SG_ALERT, "recalc_sl_temperature: " << "valid only in troposphere, not " << elevation_ft); return; } @@ -728,7 +728,7 @@ FGEnvironment::_recalc_sl_pressure () using namespace atmodel; #if 0 { - SG_LOG(SG_GENERAL, SG_ALERT, "recalc_sl_pressure: using " + SG_LOG(SG_ENVIRONMENT, SG_ALERT, "recalc_sl_pressure: using " << pressure_inhg << " and " << temperature_degc << " @ " << elevation_ft << " :: " << this); } @@ -749,7 +749,7 @@ FGEnvironment::_recalc_alt_pt () { static int count(0); if (++count % 1000 == 0) { - SG_LOG(SG_GENERAL, SG_ALERT, + SG_LOG(SG_ENVIRONMENT, SG_ALERT, "recalc_alt_pt for: " << elevation_ft << " using " << pressure_sea_level_inhg << " and " << temperature_sea_level_degc diff --git a/src/Environment/environment_ctrl.cxx b/src/Environment/environment_ctrl.cxx index c182f0625..e7c8820fa 100644 --- a/src/Environment/environment_ctrl.cxx +++ b/src/Environment/environment_ctrl.cxx @@ -182,7 +182,7 @@ void LayerTable::read(FGEnvironment * parent ) // cleanup entries with (almost)same altitude for( size_type n = 1; n < size(); n++ ) { if( fabs(at(n)->altitude_ft - at(n-1)->altitude_ft ) < 1 ) { - SG_LOG( SG_GENERAL, SG_ALERT, "Removing duplicate altitude entry in environment config for altitude " << at(n)->altitude_ft ); + SG_LOG( SG_ENVIRONMENT, SG_ALERT, "Removing duplicate altitude entry in environment config for altitude " << at(n)->altitude_ft ); erase( begin() + n ); } } diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 2eaaa8e7f..2e8ae0a92 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -134,7 +134,7 @@ FGEnvironmentMgr::~FGEnvironmentMgr () void FGEnvironmentMgr::init () { - SG_LOG( SG_GENERAL, SG_INFO, "Initializing environment subsystem"); + SG_LOG( SG_ENVIRONMENT, SG_INFO, "Initializing environment subsystem"); SGSubsystemGroup::init(); fgClouds->Init(); @@ -150,7 +150,7 @@ FGEnvironmentMgr::init () void FGEnvironmentMgr::reinit () { - SG_LOG( SG_GENERAL, SG_INFO, "Reinitializing environment subsystem"); + SG_LOG( SG_ENVIRONMENT, SG_INFO, "Reinitializing environment subsystem"); SGSubsystemGroup::reinit(); } @@ -265,7 +265,7 @@ FGEnvironmentMgr::update (double dt) // update closest airport information _positionTimeToLive = 30.0; - SG_LOG(SG_ALL, SG_INFO, "FGEnvironmentMgr::update: updating closest airport"); + SG_LOG(SG_ENVIRONMENT, SG_INFO, "FGEnvironmentMgr::update: updating closest airport"); SGGeod pos = SGGeod::fromDeg(_longitude_n->getDoubleValue(), _latitude_n->getDoubleValue()); @@ -273,7 +273,7 @@ FGEnvironmentMgr::update (double dt) FGAirport * nearestAirport = FGAirport::findClosest(pos, 100.0); if( nearestAirport == NULL ) { - SG_LOG(SG_ALL,SG_WARN,"FGEnvironmentMgr::update: No airport within 100NM range"); + SG_LOG(SG_ENVIRONMENT,SG_WARN,"FGEnvironmentMgr::update: No airport within 100NM range"); } else { @@ -428,7 +428,7 @@ void FGEnvironmentMgr::set_cloud_layer_coverage_type (int index, int type ) { if( type < 0 || type >= SGCloudLayer::SG_MAX_CLOUD_COVERAGES ) { - SG_LOG(SG_ALL,SG_WARN,"Unknown cloud layer type " << type << " ignored" ); + SG_LOG(SG_ENVIRONMENT,SG_WARN,"Unknown cloud layer type " << type << " ignored" ); return; } diff --git a/src/Environment/fgmetar.cxx b/src/Environment/fgmetar.cxx index c9d046ca9..d69bc264a 100644 --- a/src/Environment/fgmetar.cxx +++ b/src/Environment/fgmetar.cxx @@ -148,11 +148,11 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co _time = sgTimeGetGMT(_year - 1900, _month - 1, _day, _hour, _minute, 0); - SG_LOG(SG_GENERAL, SG_INFO, _data); + SG_LOG(SG_ENVIRONMENT, SG_INFO, _data); if (_x_proxy) - SG_LOG(SG_GENERAL, SG_INFO, "METAR from proxy"); + SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from proxy"); else - SG_LOG(SG_GENERAL, SG_INFO, "METAR from weather.noaa.gov"); + SG_LOG(SG_ENVIRONMENT, SG_INFO, "METAR from weather.noaa.gov"); } diff --git a/src/Environment/metarproperties.cxx b/src/Environment/metarproperties.cxx index 11971f08c..4c93aaa97 100644 --- a/src/Environment/metarproperties.cxx +++ b/src/Environment/metarproperties.cxx @@ -83,7 +83,7 @@ inline void MagneticVariation::recalc( double lon, double lat, double alt ) // calculation of magnetic variation is expensive. Cache the position // and perform this calculation only if it has changed if( _lon != lon || _lat != lat || _alt != alt ) { - SG_LOG(SG_ALL, SG_DEBUG, "Recalculating magvar for lon=" << lon << ", lat=" << lat << ", alt=" << alt ); + SG_LOG(SG_ENVIRONMENT, SG_DEBUG, "Recalculating magvar for lon=" << lon << ", lat=" << lat << ", alt=" << alt ); _lon = lon; _lat = lat; _alt = alt; @@ -194,7 +194,7 @@ void MetarProperties::set_metar( const char * metar ) m = new FGMetar( _metar ); } catch( sg_io_exception ) { - SG_LOG( SG_GENERAL, SG_WARN, "Can't parse metar: " << _metar ); + SG_LOG( SG_ENVIRONMENT, SG_WARN, "Can't parse metar: " << _metar ); _metarValidNode->setBoolValue(false); return; } diff --git a/src/Environment/realwx_ctrl.cxx b/src/Environment/realwx_ctrl.cxx index b3a55331d..c897d74b7 100644 --- a/src/Environment/realwx_ctrl.cxx +++ b/src/Environment/realwx_ctrl.cxx @@ -137,7 +137,7 @@ BasicRealWxController::BasicRealWxController( SGPropertyNode_ptr rootNode ) : PropertyList metars = rootNode->getChildren("metar"); for( PropertyList::size_type i = 1; i < metars.size(); i++ ) { - SG_LOG( SG_ALL, SG_INFO, "Adding metar properties at " << metars[i]->getStringValue() ); + SG_LOG( SG_ENVIRONMENT, SG_INFO, "Adding metar properties at " << metars[i]->getStringValue() ); _metarProperties.push_back( new LiveMetarProperties( fgGetNode( metars[i]->getStringValue(), true ))); } @@ -256,7 +256,7 @@ public: if (responseCode() == 200) { wxController->gotMetar(stationId, metar); } else { - SG_LOG(SG_IO, SG_WARN, "metar download failed:" << url() << ": reason:" << responseReason()); + SG_LOG(SG_ENVIRONMENT, SG_WARN, "metar download failed:" << url() << ": reason:" << responseReason()); } } @@ -302,23 +302,23 @@ void NoaaMetarRealWxController::update( bool first, double dt ) if( _positionTimeToLive <= 0.0 ) { // check nearest airport - SG_LOG(SG_ALL, SG_INFO, "NoaaMetarRealWxController::update(): (re) checking nearby airport with METAR" ); + SG_LOG(SG_ENVIRONMENT, SG_INFO, "NoaaMetarRealWxController::update(): (re) checking nearby airport with METAR" ); _positionTimeToLive = 60.0; SGGeod pos = SGGeod::fromDeg(_longitude_n->getDoubleValue(), _latitude_n->getDoubleValue()); FGAirport * nearestAirport = FGAirport::findClosest(pos, 10000.0, MetarAirportFilter::instance() ); if( nearestAirport == NULL ) { - SG_LOG(SG_ALL,SG_WARN,"RealWxController::update can't find airport with METAR within 10000NM" ); + SG_LOG(SG_ENVIRONMENT,SG_WARN,"RealWxController::update can't find airport with METAR within 10000NM" ); return; } - SG_LOG(SG_ALL, SG_INFO, + SG_LOG(SG_ENVIRONMENT, SG_INFO, "NoaaMetarRealWxController::update(): nearest airport with METAR is: " << nearestAirport->ident() ); // if it has changed, invalidate the associated METAR if( _metarProperties[0]->getStationId() != nearestAirport->ident() ) { - SG_LOG(SG_ALL, SG_INFO, + SG_LOG(SG_ENVIRONMENT, SG_INFO, "NoaaMetarRealWxController::update(): nearest airport with METAR has changed. Old: '" << _metarProperties[0]->getStationId() << "', new: '" << nearestAirport->ident() << "'" ); @@ -335,7 +335,7 @@ void NoaaMetarRealWxController::update( bool first, double dt ) const std::string & stationId = p->getStationId(); if( stationId.empty() ) continue; - SG_LOG(SG_ALL, SG_INFO, + SG_LOG(SG_ENVIRONMENT, SG_INFO, "NoaaMetarRealWxController::update(): spawning load request for station-id '" << stationId << "'" ); _http.makeRequest(new MetarGetRequest(this, stationId)); @@ -345,7 +345,7 @@ void NoaaMetarRealWxController::update( bool first, double dt ) void NoaaMetarRealWxController::gotMetar(const string& stationId, const string& metar) { - SG_LOG( SG_ALL, SG_INFO, "NoaaMetarRwalWxController::update() received METAR for " << stationId << ": " << metar ); + SG_LOG( SG_ENVIRONMENT, SG_INFO, "NoaaMetarRwalWxController::update() received METAR for " << stationId << ": " << metar ); BOOST_FOREACH(LiveMetarProperties* p, _metarProperties) { if (p->getStationId() != stationId) continue; diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index b98f32805..103fafecd 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -74,7 +74,12 @@ LogClassMapping log_class_mappings [] = { LogClassMapping(SG_CLIPPER, "clipper"), LogClassMapping(SG_NETWORK, "network"), LogClassMapping(SG_INSTR, "instrumentation"), + LogClassMapping(SG_ATC, "atc"), + LogClassMapping(SG_NASAL, "nasal"), LogClassMapping(SG_SYSTEMS, "systems"), + LogClassMapping(SG_AI, "ai"), + LogClassMapping(SG_ENVIRONMENT, "environment"), + LogClassMapping(SG_SOUND, "sound"), LogClassMapping(SG_UNDEFD, "") }; diff --git a/src/Main/logger.cxx b/src/Main/logger.cxx index 2a4561c73..c49904fa9 100644 --- a/src/Main/logger.cxx +++ b/src/Main/logger.cxx @@ -66,7 +66,7 @@ FGLogger::init () log.delimiter = delimiter.c_str()[0]; log.output = new ofstream(filename.c_str()); if (!log.output) { - SG_LOG(SG_INPUT, SG_ALERT, "Cannot write log to " << filename); + SG_LOG(SG_GENERAL, SG_ALERT, "Cannot write log to " << filename); continue; } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 68fa86de3..6fa94dc9b 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -134,8 +134,8 @@ static void fgMainLoop( void ) { frame_signal->fireValueChanged(); SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping"); - SG_LOG( SG_ALL, SG_DEBUG, "Running Main Loop"); - SG_LOG( SG_ALL, SG_DEBUG, "======= ==== ===="); + SG_LOG( SG_GENERAL, SG_DEBUG, "Running Main Loop"); + SG_LOG( SG_GENERAL, SG_DEBUG, "======= ==== ===="); // update "time" @@ -242,7 +242,7 @@ static void fgMainLoop( void ) { simgear::AtomicChangeListener::fireChangeListeners(); - SG_LOG( SG_ALL, SG_DEBUG, "" ); + SG_LOG( SG_GENERAL, SG_DEBUG, "" ); } void fgInitSoundManager() diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index b7f94ca08..75e0b9f92 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -279,9 +279,9 @@ FGTileMgr::loadTileModel(const string& modelPath, bool cacheModel) string m(exc.getMessage()); m += " "; m += exc.getLocation().asString(); - SG_LOG( SG_ALL, SG_ALERT, m ); + SG_LOG( SG_TERRAIN, SG_ALERT, m ); } catch (const sg_exception& exc) { // XXX may be redundant - SG_LOG( SG_ALL, SG_ALERT, exc.getMessage()); + SG_LOG( SG_TERRAIN, SG_ALERT, exc.getMessage()); } return result; } @@ -330,7 +330,7 @@ void FGTileMgr::update_queues() } } else { - SG_LOG(SG_INPUT, SG_ALERT, "Warning: empty tile in cache!"); + SG_LOG(SG_TERRAIN, SG_ALERT, "Warning: empty tile in cache!"); } tile_cache.next(); sz++; diff --git a/src/Sound/beacon.cxx b/src/Sound/beacon.cxx index f72289189..de9a98915 100644 --- a/src/Sound/beacon.cxx +++ b/src/Sound/beacon.cxx @@ -99,7 +99,7 @@ bool FGBeacon::init() { outer->set_reference_dist( 10.0 ); outer->set_max_dist( 20.0 ); } catch ( sg_io_exception &e ) { - SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage()); + SG_LOG(SG_SOUND, SG_ALERT, e.getFormattedMessage()); } return true; diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index 2953bfe67..376498c7f 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -71,19 +71,19 @@ FGFX::init() string path_str = node->getStringValue("path"); if (path_str.empty()) { - SG_LOG(SG_GENERAL, SG_ALERT, "No path in /sim/sound/path"); + SG_LOG(SG_SOUND, SG_ALERT, "No path in /sim/sound/path"); return; } SGPath path = globals->resolve_aircraft_path(path_str); - SG_LOG(SG_GENERAL, SG_INFO, "Reading sound " << node->getName() + SG_LOG(SG_SOUND, SG_INFO, "Reading sound " << node->getName() << " from " << path.str()); SGPropertyNode root; try { readProperties(path.str(), &root); } catch (const sg_exception &) { - SG_LOG(SG_GENERAL, SG_ALERT, + SG_LOG(SG_SOUND, SG_ALERT, "Error reading file '" << path.str() << '\''); return; } @@ -99,7 +99,7 @@ FGFX::init() _sound.push_back(sound); } catch ( sg_exception &e ) { - SG_LOG(SG_GENERAL, SG_ALERT, e.getFormattedMessage()); + SG_LOG(SG_SOUND, SG_ALERT, e.getFormattedMessage()); delete sound; } } diff --git a/src/Sound/voice.cxx b/src/Sound/voice.cxx index 7ba8b2fb9..df85e1a98 100644 --- a/src/Sound/voice.cxx +++ b/src/Sound/voice.cxx @@ -68,7 +68,7 @@ void FGVoiceMgr::init() for (unsigned int i = 0; i < voices.size(); i++) _voices.push_back(new FGVoice(this, voices[i])); } catch (const string& s) { - SG_LOG(SG_IO, SG_ALERT, "VOICE: " << s); + SG_LOG(SG_SOUND, SG_ALERT, "VOICE: " << s); } #if defined(ENABLE_THREADS) @@ -105,7 +105,7 @@ FGVoiceMgr::FGVoice::FGVoice(FGVoiceMgr *mgr, const SGPropertyNode_ptr node) : _festival(node->getBoolValue("festival", true)), _mgr(mgr) { - SG_LOG(SG_IO, SG_INFO, "VOICE: adding `" << node->getStringValue("desc", "") + SG_LOG(SG_SOUND, SG_INFO, "VOICE: adding `" << node->getStringValue("desc", "") << "' voice"); const string &host = _mgr->_host; const string &port = _mgr->_port; @@ -124,7 +124,7 @@ FGVoiceMgr::FGVoice::FGVoice(FGVoiceMgr *mgr, const SGPropertyNode_ptr node) : + "'. Either it's not\n Festival listening," " or Festival couldn't open a sound device."; - SG_LOG(SG_IO, SG_INFO, "VOICE: connection to Festival server on `" + SG_LOG(SG_SOUND, SG_INFO, "VOICE: connection to Festival server on `" << host << ':' << port << "' established"); setVolume(_volume = _volumeNode->getDoubleValue()); diff --git a/src/Sound/voiceplayer.cxx b/src/Sound/voiceplayer.cxx index 054a771fc..2cd2f127c 100644 --- a/src/Sound/voiceplayer.cxx +++ b/src/Sound/voiceplayer.cxx @@ -214,7 +214,7 @@ FGVoicePlayer::get_sample (const char *name) } catch (const sg_exception &e) { - SG_LOG(SG_INSTR, SG_ALERT, "Error loading sound sample \"" + filename + "\": " + e.getFormattedMessage()); + SG_LOG(SG_SOUND, SG_ALERT, "Error loading sound sample \"" + filename + "\": " + e.getFormattedMessage()); exit(1); } diff --git a/src/Systems/electrical.cxx b/src/Systems/electrical.cxx index d711b4dca..16de41f58 100644 --- a/src/Systems/electrical.cxx +++ b/src/Systems/electrical.cxx @@ -119,7 +119,7 @@ float FGElectricalSupplier::apply_load( float amps, float dt ) { float available_amps = ideal_amps; return available_amps - amps; } else { - SG_LOG( SG_ALL, SG_ALERT, "unknown supplier type" ); + SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown supplier type" ); } return 0.0; @@ -151,7 +151,7 @@ float FGElectricalSupplier::get_output_volts() { // cout << "external amps = " << 0.0 << endl; return ideal_volts; } else { - SG_LOG( SG_ALL, SG_ALERT, "unknown supplier type" ); + SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown supplier type" ); } return 0.0; @@ -180,7 +180,7 @@ float FGElectricalSupplier::get_output_amps() { // cout << "external amps = " << 0.0 << endl; return ideal_amps; } else { - SG_LOG( SG_ALL, SG_ALERT, "unknown supplier type" ); + SG_LOG( SG_SYSTEMS, SG_ALERT, "unknown supplier type" ); } return 0.0; @@ -274,12 +274,12 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node, } else if ( s->get_kind() == FG_BUS ) { s->add_output( this ); } else { - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "Attempt to connect to something that can't provide an output: " << child->getStringValue() ); } } else { - SG_LOG( SG_ALL, SG_ALERT, "Can't find named source: " + SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: " << child->getStringValue() ); } } else if ( cname == "output" ) { @@ -295,12 +295,12 @@ FGElectricalConnector::FGElectricalConnector ( SGPropertyNode *node, == FGElectricalSupplier::FG_BATTERY ) { s->add_output( this ); } else { - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "Attempt to connect to something that can't provide an input: " << child->getStringValue() ); } } else { - SG_LOG( SG_ALL, SG_ALERT, "Can't find named source: " + SG_LOG( SG_SYSTEMS, SG_ALERT, "Can't find named source: " << child->getStringValue() ); } } else if ( cname == "switch" ) { @@ -362,7 +362,7 @@ void FGElectricalSystem::init () { SGPropertyNode *path_n = fgGetNode("/sim/systems/electrical/path"); if ( path_n ) { if ( path.length() ) { - SG_LOG( SG_ALL, SG_INFO, + SG_LOG( SG_SYSTEMS, SG_INFO, "NOTICE: System manager configuration specifies an " << "electrical system: " << path << " but it is " << "being overridden by the one specified in the -set.xml " << @@ -376,7 +376,7 @@ void FGElectricalSystem::init () { SGPath config = globals->resolve_aircraft_path(path); // load an obsolete xml configuration - SG_LOG( SG_ALL, SG_WARN, + SG_LOG( SG_SYSTEMS, SG_WARN, "Reading deprecated xml electrical system model from\n " << config.str() ); try { @@ -385,21 +385,21 @@ void FGElectricalSystem::init () { if ( build(config_props) ) { enabled = true; } else { - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "Detected a logic error in the electrical system "); - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "specification file. See earlier errors for " ); - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "details."); exit(-1); } } catch (const sg_exception&) { - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "Failed to load electrical system model: " << config.str() ); } } else { - SG_LOG( SG_ALL, SG_INFO, + SG_LOG( SG_SYSTEMS, SG_INFO, "No xml-based electrical model specified for this model!"); } @@ -455,7 +455,7 @@ void FGElectricalSystem::update (double dt) { " " ); if ( node->apply_load( load, dt ) < 0.0 ) { - SG_LOG(SG_ALL, SG_ALERT, + SG_LOG(SG_SYSTEMS, SG_ALERT, "Error drawing more current than available!"); } } @@ -475,7 +475,7 @@ void FGElectricalSystem::update (double dt) { " " ); if ( node->apply_load( load, dt ) < 0.0 ) { - SG_LOG(SG_ALL, SG_ALERT, + SG_LOG(SG_SYSTEMS, SG_ALERT, "Error drawing more current than available!"); } } @@ -496,7 +496,7 @@ void FGElectricalSystem::update (double dt) { // cout << "battery load = " << load << endl; if ( node->apply_load( load, dt ) < 0.0 ) { - SG_LOG(SG_ALL, SG_ALERT, + SG_LOG(SG_SYSTEMS, SG_ALERT, "Error drawing more current than available!"); } } @@ -579,7 +579,7 @@ bool FGElectricalSystem::build (SGPropertyNode* config_props) { new FGElectricalConnector( node, this ); connectors.push_back( c ); } else { - SG_LOG( SG_ALL, SG_ALERT, "Unknown component type specified: " + SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown component type specified: " << name ); return false; } @@ -637,7 +637,7 @@ float FGElectricalSystem::propagate( FGElectricalComponent *node, double dt, } // cout << s << " input_volts = " << volts << endl; } else { - SG_LOG( SG_ALL, SG_ALERT, "unkown node type" ); + SG_LOG( SG_SYSTEMS, SG_ALERT, "unkown node type" ); } int i; diff --git a/src/Systems/system_mgr.cxx b/src/Systems/system_mgr.cxx index 0ca9efb7a..ce43ddbf8 100644 --- a/src/Systems/system_mgr.cxx +++ b/src/Systems/system_mgr.cxx @@ -36,7 +36,7 @@ FGSystemMgr::FGSystemMgr () if (path_n) { SGPath config = globals->resolve_aircraft_path(path_n->getStringValue()); - SG_LOG( SG_ALL, SG_INFO, "Reading systems from " + SG_LOG( SG_SYSTEMS, SG_INFO, "Reading systems from " << config.str() ); try { readProperties( config.str(), config_props ); @@ -44,21 +44,21 @@ FGSystemMgr::FGSystemMgr () if ( build(config_props) ) { enabled = true; } else { - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, "Detected an internal inconsistency in the systems"); - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, " system specification file. See earlier errors for" ); - SG_LOG( SG_ALL, SG_ALERT, + SG_LOG( SG_SYSTEMS, SG_ALERT, " details."); exit(-1); } } catch (const sg_exception&) { - SG_LOG( SG_ALL, SG_ALERT, "Failed to load systems system model: " + SG_LOG( SG_SYSTEMS, SG_ALERT, "Failed to load systems system model: " << config.str() ); } } else { - SG_LOG( SG_ALL, SG_WARN, + SG_LOG( SG_SYSTEMS, SG_WARN, "No systems model specified for this model!"); } @@ -92,7 +92,7 @@ bool FGSystemMgr::build (SGPropertyNode* config_props) set_subsystem( "system" + temp.str(), new VacuumSystem( node ) ); } else { - SG_LOG( SG_ALL, SG_ALERT, "Unknown top level section: " + SG_LOG( SG_SYSTEMS, SG_ALERT, "Unknown top level section: " << name ); return false; }