vsomeip
vsomeip copied to clipboard
Implement slog2 logging capability
Overview
Implement logging to slog2 when run on QNX.
Description
Implemented an slog2 logging capability into the logger which is enabled by default on QNX systems. The implementation in general is guarded with build defines, i.e. #ifdef __QNX__.
The configuration object was modified such that the slog2 logging can be controlled with /etc/vsomeip/logging.json, i.e.:
"logging": {
"slog2": true
}
This code allocates 4 pages (16kB) by default, but the caller can provide an environment variable VSOMEIP_SLOG2_NUM_PAGES to control the allocation
The logger must be initialized prior to calling config through the implementation. Because non-CommonAPI apps (e.g. routingmanagerd) can use the VSOMEIP logging macros which would trigger a logging seg fault, the message object will now output the message in the erroneous case rather than raising a seg fault.
Other changes
- Small CMake modernizations around the OS detection and how flags are applied.
- The
version-scriptis applied as a private linker option tolibvsomeip, this removes the need to remove it from theCXX_FLAGSin the test's CMake setup.
- The
- Added a call to
runtime->setProperty("LogApplication");in theroutingmanagerdexample such that it had a log tag to filter on in logcat (Android only) - Simplified the logging code by moving the functions that translate log levels to logger specific levels into sub-functions (did not do this for DLT as I am not properly setup to test this right now.)
Testing
- [x] Tested on Linux
- [x] Tested on QNX
- [x] Tested on AOSP-Vendor