Replies: 3 comments 2 replies
-
I don't think this is a bug. |
Beta Was this translation helpful? Give feedback.
-
I also noticed that logging mechanism seems unnecessarily complex and a bit unconventional. This approach makes debugging and maintaining the code harder. Additionally, I found that part of the documentation a bit hard to follow. |
Beta Was this translation helpful? Give feedback.
-
@oguzkaganozt logging mechanism is complex but i don't agree that it's unnecessary. Logging is capable of building a logging message during compilation and not runtime and that makes it super fast compared to standard string formatting allowing non-intrusive logging from any context. There are configurations where logging strings are removed from binary (dictionary logging) and many more features that would not be possible without complex preprocessor operations. |
Beta Was this translation helpful? Give feedback.
-
I've been using header-only C++ for a while now, it's convenient not having to split source and header apart. However this isn't compatible with the Zephyr logging system.
For example one cannot do something in example.h like:
or even putting LOG_MODULE_REGISTER() outside of the class doesn't work either (as example.h may be included in several locations, so the LOG_MODULE_REGISTER() is duplicated several times).
I didn't see any examples that did this with the logging system, and its been a pain separating out .h/.cpp just for the logging system (I'm used to espressif's esp-idf where the logger module is a string passed to each log call and no LOG_MODULE_REGISTER() like thing is necessary. esp-idf logging works great even if used in header only c++ projects).
Thoughts? Maybe I'm missing something relative to advanced usage?
Beta Was this translation helpful? Give feedback.
All reactions