Enhance Logging in main.c#86
Conversation
|
A potential risk of this approach is macro name clash with other codes inside your project, especially when the project contains 3rd party codes. LOG_INFO and LOG_ERROR are commonly used and therefore it might be best to add prefix in the macro names. Thanks and regards, |
|
Thanks for the suggestion, Joseph I have updated the logging macros to use an AUDIOMARK_ prefix and wrapped the definitions with #ifndef guards to avoid name clashes with other code. Thanks again for the helpful review. Best regards, |
|
Hi Vinayak, Joseph, thanks for your suggestions to further improve this benchmark. May I suggest an alternative solution? In other EEMBC/SPEC EG benchmarks, for portability "th_printf" is used instead of "printf". And it's part of the porting layer (ee_api.h) similar like other standard C functions used in the benchmark. |
|
Thanks for the suggestion. I am happy with "th_printf" too, especially that it is already available it in the API. |
|
Just to be clear, for AudioMark the "th_printf" is not in the ee_api.h. For other benchmarks it is, but here it would need to be added. |
|
Ah, thanks for your clarification. Sorry for misunderstood your previous comment. |
|
Sorry for the delay... I finally have time to look into the details. The th_printf function is a part of the EEMBC MITH (Multi-Instance Test Harness).
The disadvantage is that if someone already have a vendor specific port that use their own th_api.c, they will have to update their own code before compiling with the new version. Now the biggest issue is that printf is used in many AudioMark files. So unless there are strong demand from SPEC customers I think I will put this suggestion on hold for now. Thanks for the suggestion though. |
##Description
This PR standardizes the logging mechanism in main.c by introducing structured macros and replacing raw printf calls with LOG_INFO or LOG_ERROR for consistency.
To improve log readability, allow for easier filtering of error vs. info messages, and simplify future logging extensions.