Skip to content

Commit e26d03b

Browse files
authored
Reduce console output when debug level is zero (#1092)
1 parent 47bc8a3 commit e26d03b

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/models/FGInertial.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ bool FGInertial::Load(Element* el)
118118
GroundCallback->SetEllipse(a, b);
119119

120120
// Messages to warn the user about possible inconsistencies.
121-
if (a != b && J2 == 0.0)
122-
cout << "Gravitational constant J2 is null for a non-spherical planet." << endl;
123-
if (a == b && J2 != 0.0)
124-
cout << "Gravitational constant J2 is non-zero for a spherical planet." << endl;
121+
if (debug_lvl > 0) {
122+
if (a != b && J2 == 0.0)
123+
cout << "Gravitational constant J2 is null for a non-spherical planet." << endl;
124+
if (a == b && J2 != 0.0)
125+
cout << "Gravitational constant J2 is non-zero for a spherical planet." << endl;
126+
}
125127

126128
Debug(2);
127129

src/models/FGLGear.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,10 @@ void FGLGear::ReportTakeoffOrLanding(void)
542542

543543
if (lastWOW != WOW)
544544
{
545-
cout << "GEAR_CONTACT: " << fdmex->GetSimTime() << " seconds: " << name
546-
<< " " << WOW << endl;
545+
if (debug_lvl > 0) {
546+
cout << "GEAR_CONTACT: " << fdmex->GetSimTime() << " seconds: " << name
547+
<< " " << WOW << endl;
548+
}
547549
}
548550
}
549551

@@ -557,7 +559,10 @@ void FGLGear::CrashDetect(void)
557559
GetMoments().Magnitude() > 5000000000.0 ||
558560
SinkRate > 1.4666*30 ) && !fdmex->IntegrationSuspended())
559561
{
560-
cout << "*CRASH DETECTED* " << fdmex->GetSimTime() << " seconds: " << name;
562+
if (debug_lvl > 0) {
563+
cout << "*CRASH DETECTED* " << fdmex->GetSimTime() << " seconds: " << name;
564+
}
565+
561566
// fdmex->SuspendIntegration();
562567
}
563568
}

0 commit comments

Comments
 (0)