Skip to content

Logging redesign - part 7#1405

Merged
bcoconni merged 4 commits intoJSBSim-Team:masterfrom
bcoconni:logging7
Mar 31, 2026
Merged

Logging redesign - part 7#1405
bcoconni merged 4 commits intoJSBSim-Team:masterfrom
bcoconni:logging7

Conversation

@bcoconni
Copy link
Copy Markdown
Member

Following the PR #1401, this is the final PR of the migration to the new logging system started almost 2 years ago with the PR #1094.

Note that JSBSim.cpp and the directory src/utilities will not be migrated. The first being the source code of a command line executable which obviously needs to display output in the console. The second contains utilities to plot curves using the dislin library.

Remaining occurrences of cout

After this PR the following occurrences of cout will remain:

std::cout << "Trim Failed" << std::endl;

std::cout << "Trim Failed" << std::endl;

data goes to that file. If "COUT" or "cout" is specified, the

std::cout << buffer;
std::cout.flush(); // Force the message to be immediately displayed in the console

The first three are occurring in a comment that gives an example of C++ code or document the class. The last one is in FGLogConsole that obviously needs to use std::cout.

Remaining occurrences of cerr

The only last occurrence of cerr is in FGLogConsole to display the error messages using std::cerr

std::cerr << buffer;
std::cerr.flush(); // Force the message to be immediately displayed in the console

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 19.83968% with 400 lines in your changes missing coverage. Please review.
✅ Project coverage is 25.12%. Comparing base (98c0333) to head (e00d49f).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/math/FGFunction.cpp 0.00% 139 Missing ⚠️
src/models/propulsion/FGTank.cpp 0.00% 53 Missing ⚠️
src/models/propulsion/FGPiston.cpp 0.00% 40 Missing ⚠️
src/models/propulsion/FGEngine.cpp 0.00% 27 Missing ⚠️
src/models/propulsion/FGBrushLessDCMotor.cpp 0.00% 21 Missing ⚠️
src/models/propulsion/FGTurbine.cpp 0.00% 19 Missing ⚠️
src/math/FGCondition.cpp 0.00% 16 Missing ⚠️
src/models/propulsion/FGTurboProp.cpp 0.00% 16 Missing ⚠️
src/math/FGStateSpace.h 0.00% 13 Missing ⚠️
src/models/propulsion/FGRocket.cpp 0.00% 13 Missing ⚠️
... and 5 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1405      +/-   ##
==========================================
- Coverage   25.23%   25.12%   -0.11%     
==========================================
  Files         169      169              
  Lines       18631    18719      +88     
==========================================
+ Hits         4701     4703       +2     
- Misses      13930    14016      +86     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@seanmcleod70
Copy link
Copy Markdown
Contributor

Looks good, and some proof I made it to the end of https://github.com/JSBSim-Team/jsbsim/pull/1405/changes 😉

image

So I guess now we can ping the FlightGear team and let them know that they can start looking into making use of the new logging system.

@bcoconni
Copy link
Copy Markdown
Member Author

Congrats @seanmcleod70 ! And thanks.
Since I know the pain it was to code it, I can only imagine how much painful it was to review it.

So I guess now we can ping the FlightGear team and let them know that they can start looking into making use of the new logging system.

I have already given them a teaser about that 😄

@bcoconni bcoconni merged commit 289e3c0 into JSBSim-Team:master Mar 31, 2026
30 checks passed
@bcoconni bcoconni deleted the logging7 branch March 31, 2026 07:25
@bcoconni
Copy link
Copy Markdown
Member Author

The PR is now merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants