1
0
Fork 0

Remove some debug log calls.

All places which continuously log messages (either every frame or at
least every second) tending to swamp other log output.
This commit is contained in:
James Turner 2014-01-23 13:49:58 +00:00
parent 45d67406a4
commit c6541e9c8f
5 changed files with 1 additions and 81 deletions

View file

@ -1025,14 +1025,6 @@ bool FGATIS::search(double dt)
RangeFilter rangeFilter(aircraftPos );
CommStation* sta = CommStation::findByFreq(freqKhz, aircraftPos, &rangeFilter );
SetStation(sta);
if (sta && sta->airport())
{
SG_LOG(SG_ATC, SG_DEBUG, "FGATIS " << _name << ": " << sta->airport()->name());
}
else
{
SG_LOG(SG_ATC, SG_DEBUG, "FGATIS " << _name << ": no station.");
}
return true;
}

View file

@ -40,7 +40,6 @@ adjust_range (double transmitter_elevation_ft, double aircraft_altitude_ft,
else if (range_nm < 20.0)
range_nm = 20.0;
double rand = sg_random();
SG_LOG( SG_INSTR, SG_DEBUG, " tacan range " << range_nm << " max range " << max_range_nm);
return range_nm + (range_nm * rand * rand);
}
@ -136,7 +135,6 @@ TACAN::update (double delta_time_sec)
_distance_node->setDoubleValue(0);
_speed_node->setDoubleValue(0);
_time_node->setDoubleValue(0);
SG_LOG( SG_INSTR, SG_DEBUG, "skip tacan" );
return;
}
@ -153,8 +151,6 @@ TACAN::update (double delta_time_sec)
double mobile_bearing = 0;
double mobile_distance = 0;
SG_LOG( SG_INSTR, SG_DEBUG, "mobile_name " << _mobile_name);
SG_LOG( SG_INSTR, SG_DEBUG, "mobile_valid " << _mobile_valid);
geo_inverse_wgs_84(pos, _mobilePos,
&mobile_bearing, &mobile_az2, &mobile_distance);
@ -170,8 +166,6 @@ TACAN::update (double delta_time_sec)
//select the nearer
if ( mobile_distance <= distance && _mobile_valid) {
SG_LOG( SG_INSTR, SG_DEBUG, "mobile_distance_m " << mobile_distance);
SG_LOG( SG_INSTR, SG_DEBUG, "distance_m " << distance);
bearing = mobile_bearing;
distance = mobile_distance;
_transmitter_pos.setElevationFt(_mobilePos.getElevationFt());
@ -200,15 +194,10 @@ TACAN::update (double delta_time_sec)
double horiz_offset = bearing;
SG_LOG( SG_INSTR, SG_DEBUG, "distance_nm " << distance_nm << " bearing "
<< bearing << " horiz_offset " << horiz_offset);
// calculate values for radar display
double y_shift = distance_nm * cos( horiz_offset * SG_DEGREES_TO_RADIANS);
double x_shift = distance_nm * sin( horiz_offset * SG_DEGREES_TO_RADIANS);
SG_LOG( SG_INSTR, SG_DEBUG, "y_shift " << y_shift << " x_shift " << x_shift);
double rotation = 0;
double range_nm = adjust_range(_transmitter_pos.getElevationFt(),
@ -269,15 +258,12 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
int number, i;
_mobile_valid = false;
SG_LOG( SG_INSTR, SG_DEBUG, "tacan freq " << frequency_mhz );
// reset search time
_time_before_search_sec = 1.0;
//try any carriers first
FGNavRecord *mobile_tacan = FGNavList::findByFreq( frequency_mhz, FGNavList::carrierFilter() );
bool freq_valid = (mobile_tacan != NULL);
SG_LOG( SG_INSTR, SG_DEBUG, "mobile freqency valid " << freq_valid );
if ( freq_valid ) {
@ -288,15 +274,11 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
number = carrier.size();
SG_LOG( SG_INSTR, SG_DEBUG, "carrier " << number );
for ( i = 0; i < number; ++i ) {
string str2 ( carrier[i]->getStringValue("name", ""));
SG_LOG( SG_INSTR, SG_DEBUG, "carrier name " << str2 );
SG_LOG( SG_INSTR, SG_DEBUG, "strings 1 " << str1 << " 2 " << str2 );
string::size_type loc1= str1.find( str2, 0 );
if ( loc1 != string::npos && str2 != "" ) {
SG_LOG( SG_INSTR, SG_DEBUG, " string found" );
_mobilePos = SGGeod::fromDegFt(
carrier[i]->getDoubleValue("position/longitude-deg"),
carrier[i]->getDoubleValue("position/latitude-deg"),
@ -306,34 +288,23 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
_mobile_name = mobile_tacan->name();
_mobile_ident = mobile_tacan->get_trans_ident();
_mobile_valid = true;
SG_LOG( SG_INSTR, SG_DEBUG, " carrier transmitter valid " << _mobile_valid );
break;
} else {
_mobile_valid = false;
SG_LOG( SG_INSTR, SG_DEBUG, " carrier transmitter invalid " << _mobile_valid );
}
}
//try any AI tankers second
if ( !_mobile_valid) {
SG_LOG( SG_INSTR, SG_DEBUG, "tanker transmitter valid start " << _mobile_valid );
SGPropertyNode * branch = fgGetNode("ai/models", true);
vector<SGPropertyNode_ptr> tanker = branch->getChildren("tanker");
number = tanker.size();
SG_LOG( SG_INSTR, SG_DEBUG, "tanker number " << number );
for ( i = 0; i < number; ++i ) {
string str4 ( tanker[i]->getStringValue("callsign", ""));
SG_LOG( SG_INSTR, SG_DEBUG, "tanker callsign " << str4 );
SG_LOG( SG_INSTR, SG_DEBUG, "strings 1 " << str1 << " 4 " << str4 );
string::size_type loc1= str1.find( str4, 0 );
if ( loc1 != string::npos && str4 != "" ) {
SG_LOG( SG_INSTR, SG_DEBUG, " string found" );
_mobilePos = SGGeod::fromDegFt(
tanker[i]->getDoubleValue("position/longitude-deg"),
tanker[i]->getDoubleValue("position/latitude-deg"),
@ -345,11 +316,9 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
_mobile_name = mobile_tacan->name();
_mobile_ident = mobile_tacan->get_trans_ident();
_mobile_valid = true;
SG_LOG( SG_INSTR, SG_DEBUG, " tanker transmitter valid " << _mobile_valid );
break;
} else {
_mobile_valid = false;
SG_LOG( SG_INSTR, SG_DEBUG, " tanker transmitter invalid " << _mobile_valid );
}
}
}
@ -357,24 +326,16 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
//try any mp tankers third, if we haven't found the tanker in the ai aircraft
if ( !_mobile_valid ) {
SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker transmitter valid start " << _mobile_valid );
SGPropertyNode * branch = fgGetNode("ai/models", true);
vector<SGPropertyNode_ptr> mp_tanker = branch->getChildren("multiplayer");
number = mp_tanker.size();
SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker number " << number );
if ( number > 0 ) { // don't do this if there are no MP aircraft
for ( i = 0; i < number; ++i ) {
string str6 ( mp_tanker[i]->getStringValue("callsign", ""));
SG_LOG( SG_INSTR, SG_DEBUG, "mp tanker callsign " << str6 );
SG_LOG( SG_INSTR, SG_DEBUG, "strings 1 " << str1 << " 5 " << str6 );
string::size_type loc1= str1.find( str6, 0 );
if ( loc1 != string::npos && str6 != "" ) {
SG_LOG( SG_INSTR, SG_DEBUG, " string found" );
_mobilePos = SGGeod::fromDegFt(
mp_tanker[i]->getDoubleValue("position/longitude-deg"),
mp_tanker[i]->getDoubleValue("position/latitude-deg"),
@ -386,21 +347,15 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
_mobile_name = mobile_tacan->name();
_mobile_ident = mobile_tacan->get_trans_ident();
_mobile_valid = true;
SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker transmitter valid " << _mobile_valid );
SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker name " << _mobile_name);
SG_LOG( SG_INSTR, SG_DEBUG, " mp range " << _mobile_range_nm);
break;
} else {
_mobile_valid = false;
SG_LOG( SG_INSTR, SG_DEBUG, " mp tanker transmitter invalid " << _mobile_valid );
}
}
}
}
}
} else {
_mobile_valid = false;
SG_LOG( SG_INSTR, SG_DEBUG, " mobile transmitter invalid " << _mobile_valid );
}
// try the TACAN/VORTAC list next
@ -409,7 +364,6 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
_transmitter_valid = (tacan != NULL);
if ( _transmitter_valid ) {
SG_LOG( SG_INSTR, SG_DEBUG, "transmitter valid " << _transmitter_valid );
_transmitter_pos = tacan->geod();
_transmitter_range_nm = tacan->get_range();
@ -418,12 +372,6 @@ TACAN::search (double frequency_mhz,const SGGeod& pos)
_name_node->setStringValue(_transmitter_name.c_str());
_transmitter_ident = tacan->get_trans_ident();
_ident_node->setStringValue(_transmitter_ident.c_str());
SG_LOG( SG_INSTR, SG_DEBUG, "name " << _transmitter_name);
SG_LOG( SG_INSTR, SG_DEBUG, _transmitter_pos);
} else {
SG_LOG( SG_INSTR, SG_DEBUG, "transmitter invalid " << _transmitter_valid );
}
}

View file

@ -154,7 +154,6 @@ void TileCache::clear_cache() {
for ( ; current != end; ++current ) {
long index = current->first;
SG_LOG( SG_TERRAIN, SG_DEBUG, "clearing " << index );
TileEntry *e = current->second;
if ( e->is_loaded() ) {
e->tile_bucket.make_bad();

View file

@ -101,8 +101,6 @@ TileEntry::addToSceneGraph(osg::Group *terrain_branch)
void
TileEntry::removeFromSceneGraph()
{
SG_LOG( SG_TERRAIN, SG_DEBUG, "disconnecting TileEntry nodes" );
if (! is_loaded()) {
SG_LOG( SG_TERRAIN, SG_DEBUG, "removing a not-fully loaded tile!" );
} else {

View file

@ -212,8 +212,6 @@ void FGLight::update_sky_color () {
const SGVec4f base_sky_color( 0.31, 0.43, 0.69, 1.0 );
const SGVec4f base_fog_color( 0.63, 0.72, 0.88, 1.0 );
SG_LOG( SG_EVENT, SG_DEBUG, "Updating light parameters." );
// calculate lighting parameters based on sun's relative angle to
// local up
float av = _humidity->getFloatValue() * 45;
@ -221,7 +219,6 @@ void FGLight::update_sky_color () {
float visibility_inv = (45000.0 - av)/45000.0;
float deg = _sun_angle * SGD_RADIANS_TO_DEGREES;
SG_LOG( SG_EVENT, SG_DEBUG, " Sun angle = " << deg );
if (_saturation < 0.0) _saturation = 0.0;
else if (_saturation > 1.0) _saturation = 1.0;
@ -240,10 +237,6 @@ void FGLight::update_sky_color () {
specular *= _saturation;
sky_brightness *= _saturation;
SG_LOG( SG_EVENT, SG_DEBUG,
" ambient = " << ambient << " diffuse = " << diffuse
<< " specular = " << specular << " sky = " << sky_brightness );
// sky_brightness = 0.15; // used to force a dark sky (when testing)
/** fog color */
@ -393,8 +386,6 @@ void FGLight::update_adj_fog_color () {
void FGLight::updateSunPos()
{
SGTime *t = globals->get_time_params();
SG_LOG( SG_EVENT, SG_DEBUG, " Updating Sun position" );
SG_LOG( SG_EVENT, SG_DEBUG, " Gst = " << t->getGst() );
fgSunPositionGST(t->getGst(), &_sun_lon, &_sun_lat);
@ -406,11 +397,6 @@ void FGLight::updateSunPos()
SGVec3d sunpos = SGVec3d::fromGeoc(SGGeoc::fromRadM(_sun_lon, _sun_lat,
SGGeodesy::EQURAD));
SG_LOG( SG_EVENT, SG_DEBUG, " t->cur_time = " << t->get_cur_time() );
SG_LOG( SG_EVENT, SG_DEBUG,
" Sun Geocentric lat = " << _sun_lat
<< " Geodcentric lat = " << _sun_lat );
// update the sun light vector
_sun_vec = SGVec4f(toVec3f(normalize(sunpos)), 0);
_sun_vec_inv = - _sun_vec;
@ -430,9 +416,6 @@ void FGLight::updateSunPos()
double signedPI = (_sun_angle < 0.0) ? -SGD_PI : SGD_PI;
_sun_angle = fmod(_sun_angle+signedPI, SGD_2PI) - signedPI;
SG_LOG( SG_EVENT, SG_DEBUG, "sun angle relative to current location = "
<< get_sun_angle() );
// Get direction to the sun in the local frame.
SGVec3d local_sun_vec = hlOr.transform(nsun);