Problem

How is possible to set the threshold level of RT logs?

Solution

RT logs (==logs that come from RT: kernel or user space) can have one of the following levels (=priorities):


RTLOG_TRACE2 
RTLOG_DEBUG3 
RTLOG_INFO4=RTLOG_NORMAL (removed with ACS-7.0)
RTLOG_NOTICE5 
RTLOG_WARNING6 
RTLOG_ERROR8 
RTLOG_CRITICAL9 
RTLOG_ALERT10 
RTLOG_EMERGENCY11 

There are two ways to set the threshold level for rtlogs:

Compile time setting of rt logs threshold level

Compile time threshold level can be set by defining (=sending a compile options to the compiler) RTLOG_LEVEL. This can be set in the makefile. Here are examples of setting the level for user and kernel space code:

USER_CFLAGS = -DRTLOG_LEVEL=0     # for user space 
USER_RTAI_CFLAGS = -DRTLOG_LEVEL=0  # for kernel modules (=LKMs)

Setting RTLOG_LEVEL to 2 or less it means that we will get RT logs with all priorities.

Default value (=if RTLOG_LEVEL is not set) is: RTLOG_TRACE (=2) lowest possible! (see COMP-1342)

When RTLOG_LEVEL is set to the certain value code for log messages with priorities lower than one set in RTLOG_LEVEL is not not generated, so the performance is improved.

Runtime setting of rt logs threshold level

Runtime threshold level can be set by using setLevel method of rtlog component. The current threshold level value can be retrieved using getLevel method.

Be aware that compile time level setting of threshold override the runtime setting. With other words, if you set at compile time the level to 5 (=RTLOG_INFO), you can not set at runtime the level lower than this value, and consequently you can not get logs with priorities lower than RTLOG_INFO.

#CDBSetting

Set the initial runtime RT log threshold level in CDB

The initial value of the runtime RT log threshold level can be set in the CDB, in the attribute: initLogLevel of RTLOG component.

The default value is 4 (=RTLOG_INFO)!


-- BogdanJeram - 09 Aug 2007