RDK Resources
[*RDK Preferred*]
Code Management Facility
RDK Forums
[RDK Conferences]
RDK Support
Archives
Papers & Presentations Archive
Provides common logging capability for all RDK components.RDK Logger is a common logging library which is based on MPEOS logging & it uses log4c for formatting and supports multiple log levels
Default level of logging is ERROR. But Logging settings are configured in debug.ini
LOG.RDK.<component1> = FATAL ERROR WARNING NOTICE INFO
LOG.RDK.<component2> = FATAL ERROR WARNING NOTICE INFO DEBUG
Include rdk_debug.h header file and make use of RDK_LOG for printing logs. Initialize RDK Logger by calling rdk_logger_init() in the respective module/component. Build new module/component by linking "librdkloggers.so" along with "liblog4c.so" and "libglib-2.0.so" shared object.
Example: -lrdkloggers -L ../opensource/lib -llog4c -lglib-2.0
RDK_LOG (rdk_LogLevel level, const char *module, const char *format,...)
...
For example, add a debug messages for "INBSI" module
...
RDK_LOG (RDK_LOG_NOTICE, "LOG.RDK.INBSI","<%s: %s>: Sending PMT_ACQUIRED event\n", PSIMODULE, __FUNCTION__);
User needs to provide the module name "LOG.RDK.INBSI", which is the same as mentioned in debug.ini
$ cat debug.ini
EnableMPELog = TRUE
LOG.RDK.INBSI = ALL FATAL ERROR WARNING NOTICE INFO DEBUG
...
131011-21:21:49.578394 [mod=INBSI, lvl=NOTICE] [tid=4141] <SITP_PSI: NotifyTableChanged>: Sending PMT_ACQUIRED event
In this way, user make use of the RDK logger in the respective modules and control the logging levels through configuration file. Here, No need to build RDK logger again for the addition of new components/module.
A callback function gst_debug_add_log_function() is registered to receive gstreamer GStreamer logs.
Logs Logs are converted to RDK logs in callback function.
RMF RMF element which controls a gst-element shall register element name and corresponding log module using
void RMF_registerGstElementDbgModule(char *gst_module, char *rmf_module)
Callback function uses this information to get module names corresponding to gstreamer logs.
RDK Logging architecture
By default, stdout is redirected to /opt/logs/ocapri_log.txt for OCAP RI related logs.
Used By
All RDK Components
Uses
Used in Features
All
Interfaces
link to SVN or published/generated documentation
Owner
Hong Li
Code
Current Version - none
Change History - none
Known issues - none
By default, stdout is redirected to /opt/logs/ocapri_log.txt for OCAP RI related logs.
Default level of logging is ERROR. But Logging settings are configured in debug.ini
LOG.RDK.<component1> = FATAL ERROR WARNING NOTICE INFO
LOG.RDK.<component2> = FATAL ERROR WARNING NOTICE INFO DEBUG
Use RDK_LOG debug message as.
...
Example:
The debug messages for "INBSI" module
RDK_LOG (RDK_LOG_NOTICE, "LOG.RDK.INBSI","<%s: %s>: Sending PMT_ACQUIRED event\n", PSIMODULE, __FUNCTION__);
Here,
User needs to provide the module name "LOG.RDK.INBSI" , which is the same as mentioned in debug.ini
$ cat debug.ini
EnableMPELog = TRUE
LOG.RDK.INBSI = ALL FATAL ERROR WARNING NOTICE INFO DEBUG
Sample Output:
131011-21:21:49.578394 [mod=INBSI, lvl=NOTICE] [tid=4141] <SITP_PSI: NotifyTableChanged>: Sending PMT_ACQUIRED event
This way user make use of the logger in the respective modules and control the logging levels through configuration file.
Here, No need to build rdklogger again for the addition of new components/module.
Note:
Now, "mediaframework/qamsource/debug.ini" is no more in use, instead "rdklogger/debug.ini" is used and it gets copied to "/mnt/nfs/env"
Example:
-lrdkloggers -L ../opensource/lib -llog4c -lglib-2.0
RDK_LOG (RDK_LOG_NOTICE, "LOG.RDK.INBSI","<%s: %s>: Sending PMT_ACQUIRED event\n", PSIMODULE, __FUNCTION__);