You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you asked me about the improvement to µOS++ that I would wish an update for, I'd say its the logging.
I have turned logging off completely because my applications already uses the ITM trace and I couldn't make both coexist in a reasonable manner. I see two problems with the current implementation
Log messages are too condensed
I guess this is due to performance reasons. I don't know what big of an influence the message length has vs the impact of calling into printf formatting at all. But as a developer I would kind of expect performance to decrease when having logging enabled so adding a bit of verbosity shouldn't hurt too much.
There are too little options to filter in which context a specific message should be printed or not
Right now there is only the option to enable/disable all logging for a specific type of object at compile time. In my experience this is not enough for targeted debugging. What would be great is:
Add a level to every message (for example Error, Warning, Info, Debug, Verbose)
Compile-time filtering by level to be omitted from the build completely
Changing the active level at run-time (with RAII helpers that restore the previous level when they go out of scope)
Global and per-thread level (I implemented that by extending os_thread_user_storage_t)
Ensure consistency of log messages (I protected the formatting and sending of every message by a robust mutex but that's probably not an ideal solution)
Use fmt for formatting (I have not used it myself but it has been added to the standard in c++20 although neither gcc not llvm seem to have integrated it yet)
Log messages are too condensed - I guess this is due to performance reasons
That's correct, in some places time is critical and I tried to impact performances as little as possible. But I think that this can be changed, with a configuration variable we can emit longer messages.
Error, Warning, Info, Debug, Verbose
Yes, I considered this, but had no time to implement it yet. Hopefully in the next iteration. I have no experience with Zephyr, but if you think it is worth looking at, we'll consider it.
Use fmt for formatting
Yes, that's an idea worth considering. And I guess there might be more C++20 nice features to consider.
Actually I planned a rework of the newlib stdio functions, aiming for a better integration with the C++ functions. The idea was to have some core formatting functions, to be used both in C and C++, and some years ago I did some experiments, but I had no time to review them.
If you asked me about the improvement to µOS++ that I would wish an update for, I'd say its the logging.
I have turned logging off completely because my applications already uses the ITM trace and I couldn't make both coexist in a reasonable manner. I see two problems with the current implementation
Log messages are too condensed
I guess this is due to performance reasons. I don't know what big of an influence the message length has vs the impact of calling into
printf
formatting at all. But as a developer I would kind of expect performance to decrease when having logging enabled so adding a bit of verbosity shouldn't hurt too much.There are too little options to filter in which context a specific message should be printed or not
Right now there is only the option to enable/disable all logging for a specific type of object at compile time. In my experience this is not enough for targeted debugging. What would be great is:
os_thread_user_storage_t
)I think the zephyr logging module is also worth looking at.
Would be interested in hearing your thoughts about that..
The text was updated successfully, but these errors were encountered: