real-time-logging

Hi,
I have a question about debugging in real time tasks. I am aware that normal logging mechanisms in a real time context will destroy the real time. That's why I use RTT::Logger mechanisms with log(Info) and I switch on RTT::log().allowRealTime() in main.cc. Do I understand the description of RTT::Logger correct, that this combination won't effect the real time, when the logging messages will be saved to orocos.log?

http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_...

main.cc
RTT::log().allowRealTime();

Some Task:
RTT::Logger::In log(name);
RTT::log(RTT::Info)<<msg<<RTT::endlog();

Thanks
Sandra

real-time-logging

On Mar 24, 2014, at 09:45 , Sandra Beyer <sandra [dot] beyer [..] ...> wrote:

> Hi,
> I have a question about debugging in real time tasks. I am aware that normal logging mechanisms in a real time context will destroy the real time. That’s why I use RTT::Logger mechanisms with log(Info) and I switch on RTT::log().allowRealTime() in main.cc. Do I understand the description of RTT::Logger correct, that this combination won’t effect the real time, when the logging messages will be saved to orocos.log?
>
> http://www.orocos.org/stable/documentation/rtt/v2.x/api/html/classRTT_1_...
>
> main.cc
> RTT::log().allowRealTime();
>
> Some Task:
> RTT::Logger::In log(name);
> RTT::log(RTT::Info)<<msg<<RTT::endlog();
>
> Thanks
> Sandra

The RTT::Logger can never be realtime. The implementation of RTT::Logger::allowRealTime() is empty - it does nothing. The RTT::Logger implementation is rampant with file access, and use of std::string and std::stringstream, all of which are non-deterministic and hence not real time.

AFAIK the only way to log in real-time in RTT is to use the real-time logging extensions along with log4cpp. I wrote the following for RTT v1, but it appears to contain v2 updates.

http://www.orocos.org/wiki/rtt/rtt-20/real-time-logging/using-real-time-...

HTH
S