Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reduce console output when debug level is zero #1092

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/models/FGInertial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@
GroundCallback->SetEllipse(a, b);

// Messages to warn the user about possible inconsistencies.
if (a != b && J2 == 0.0)
cout << "Gravitational constant J2 is null for a non-spherical planet." << endl;
if (a == b && J2 != 0.0)
cout << "Gravitational constant J2 is non-zero for a spherical planet." << endl;
if (debug_lvl > 0) {
if (a != b && J2 == 0.0)
cout << "Gravitational constant J2 is null for a non-spherical planet." << endl;
if (a == b && J2 != 0.0)
cout << "Gravitational constant J2 is non-zero for a spherical planet." << endl;

Check warning on line 125 in src/models/FGInertial.cpp

View check run for this annotation

Codecov / codecov/patch

src/models/FGInertial.cpp#L121-L125

Added lines #L121 - L125 were not covered by tests
}

Debug(2);

Expand Down
11 changes: 8 additions & 3 deletions src/models/FGLGear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,10 @@

if (lastWOW != WOW)
{
cout << "GEAR_CONTACT: " << fdmex->GetSimTime() << " seconds: " << name
<< " " << WOW << endl;
if (debug_lvl > 0) {
cout << "GEAR_CONTACT: " << fdmex->GetSimTime() << " seconds: " << name
<< " " << WOW << endl;

Check warning on line 547 in src/models/FGLGear.cpp

View check run for this annotation

Codecov / codecov/patch

src/models/FGLGear.cpp#L545-L547

Added lines #L545 - L547 were not covered by tests
}
}
}

Expand All @@ -557,7 +559,10 @@
GetMoments().Magnitude() > 5000000000.0 ||
SinkRate > 1.4666*30 ) && !fdmex->IntegrationSuspended())
{
cout << "*CRASH DETECTED* " << fdmex->GetSimTime() << " seconds: " << name;
if (debug_lvl > 0) {
cout << "*CRASH DETECTED* " << fdmex->GetSimTime() << " seconds: " << name;

Check warning on line 563 in src/models/FGLGear.cpp

View check run for this annotation

Codecov / codecov/patch

src/models/FGLGear.cpp#L562-L563

Added lines #L562 - L563 were not covered by tests
}

// fdmex->SuspendIntegration();
}
}
Expand Down
Loading