Closed shanthakumarks closed 2 years ago
To add to Shantha's comment, we would like to request that the above code be replaced with something like the one below. This is low-risk and should have no effect on any current implementations in the field.
Thanks.
Could you just register a function to perform the logging using the log_message_cb field of USP_REGISTER_CoreVendorHooks() ? When using that callback, the logging is in addition to the standard logging. To throwaway the standard logging use a file target of '-l stdout' and redirect to /dev/nul, when invoking OBUSPA.
Closing the issue, assuming that the log_message_cb vendor hook is sufficient. If not, please re-open.
We are planning to use our own vendor specific logging functions instead of using USP_LOG_XXX functions that are defined in src/core/usp_log.h. Basically we would like to write different #define values for the following functions through vendor_defs.h and comment out the following lines in the usp_log.h .
define USP_LOG_Error(...) if (usp_log_level >= kLogLevel_Error) { USP_LOG_Printf(kLogType_Debug, __VA_ARGS__); if (enable_callstack_debug) { USP_LOG_Callstack(); } }
define USP_LOG_Warning(...) if (usp_log_level >= kLogLevel_Warning) { USP_LOG_Printf(kLogType_Debug, __VA_ARGS__); }
define USP_LOG_Info(...) if (usp_log_level >= kLogLevel_Info) { USP_LOG_Printf(kLogType_Debug, __VA_ARGS__); }
define USP_LOG_Debug(...) if (usp_log_level >= kLogLevel_Debug) { USP_LOG_Printf(kLogType_Debug, __VA_ARGS__); }
We do not want to touch the files under src/core being an integrator. Can we request you to have the above #define code to be wrapped with a #ifndef /#endif statement (like how some of the Device.DeviceInfo. object parameters are made vendor specific by using #ifndef/endif) so that the above piece of code can be conditionally removed based on what is defined in vendor_defs.h. This way , the integrators will get an option to define their own logging functions instead of using USP_LOG_XXX fucntions.