-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging redesign - part 3 #1147
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1147 +/- ##
==========================================
- Coverage 25.13% 25.12% -0.01%
==========================================
Files 170 170
Lines 18325 18337 +12
==========================================
+ Hits 4606 4608 +2
- Misses 13719 13729 +10 ☔ View full report in Codecov by Sentry. |
Looks good. One follow-up question, partly triggered by #834 (comment) in terms of state reports from notify sections in scripts. When we update jsbsim/src/input_output/FGLog.h Lines 66 to 73 in f33f20e
Or are they separate from debug logging, with it's varying levels of debug detail/level? |
That's a good question. All messages are meant to be processed by |
And speaking about #834, I have just committed some changes to replace the occurrences of |
Yep, I understand the performance reason, personally just find it more difficult to read the text in the editor with `\n' appended to the last word 😢 Not sure if the following compile time concatenation would be to the liking of other developers 😉 cout << " aircraft config file. (LIFT DRAG)\n";
cout << " aircraft config file. (LIFT DRAG)" "\n";
Hmm, wondering whether we end up needing a bitmask approach? |
I have no strong opinion regarding this. Feel free to modify this PR branch (
What do you mean ? Can you detail your thoughts ? |
I've just pushed another commit to this PR to replace a couple of |
Or alternatively you can create your own branch and I'll cherry pick your commits to reformat the |
Or should I wait for you to finish updating the whole code base to use the new logging mechanism, and then submit a PR that does this reformatting across the whole code base as a single commit? |
Sounds good 👍 |
So we currently have: jsbsim/src/input_output/FGLog.h Lines 66 to 73 in e3ac75a
With a rough assumption of decreasing verbosity from But I was wondering whether a user/developer may want to cherry pick, i.e. via a bitmask, e.g. selecting for example, |
I agree that the method As you mentioned, different users may have very different needs and for that very reason I think that filtering strategies must not be dictated from the top by the That being said, if we want to allow using a bitmask, I think it's possible to attribute power of 2's values to each element of enum class LogLevel {
BULK = 1, // For frequent messages
DEBUG = 2, // Less frequent debug type messages
INFO = 4, // Informatory messages
WARN = 8, // Possible impending problem
ERROR = 16, // Problem that can be recovered
FATAL = 32 // Fatal problem => an exception will be thrown
}; |
Will we merge this PR? @bcoconni |
Yes, sure. Done ! 😉 |
After some consolidation of the logging code (PR #1141, ##1142 and ##1145), this PR resumes the migration of the code to the new logging system.
I took this opportunity to:
FGLogging
fromlevel
tolog_level
for more clarity and to avoid confusion with the method parameters ofFGLogging
which tend to be namedlevel
as well.FGLogger
toFGLogConsole
as I think the implementation of this feature should not be imposed by the mother classFGLogger
.FGLogConsole
has been extended to check that the minimum logged level behave as intended.LogLevel::BULK
so that it does not filter anything by default.There are also a few white spaces changes because I've set my editor to remove trailing spaces before saving. Yes I'm that kind of person who can't resist taking care of this kind of futile details 😄