From: Konstantin L. <to....@gm...> - 2009-10-26 06:10:46
|
S Roderick пишет: > Actually, no. We derive from log4cpp::Category and extend it to use a > buffer of log4cpp::LoggingEvent entries. Attached to this buffer are > one or more Appender components, each of which contains an appender > internally. The category side is real-time, the appender side is not. > This is being integrated within a real-time robotics framework called > Orocos (http://orocos.org/). Our Category object contains a reference > to the real-time buffer, as well as overriding Category::callAppenders > () to push to the port instead of directly calling the appenders. This > provides the separation between the real-time and non-realtime parts > of the system. Orocos deals with creating the ports and associating > things correctly. > > So with the changes I'm proposing, the hiearachy maintainer needs to > create derived Category objects, and LoggingEvents must use a real- > time allocator (based on TLSF) to be useable within the real-time, > Category side of the system. Once everything is in the non-realtime > part of the system (ie within appenders and layouts), we no longer > care about real-time and can revert to std::string and the default > (very non-realtime) memory allocator. > > I hope this explains the situation better. Yes. Thanx. If I correctly understand all you wishes you need to collect and send all logging events into some sink in real-time manner. So base on this I propose next steps: 1. Create RT Category class. 2. Instruct somehow log4cpp to create RTCategory in HierarchyMaintainer . 3. Collect all events (not LogingEvents) in a rt buffer and send they into a sink - serialize and send to socket for example. 4. On other side of sink you may have some listener that receive, deserialize and invoke log4cpp with preconfigured nonrt categories/appenders to do real logging. To do all this work you don't need to modify LoggingEvent, because you may use whatever logging event container you need in RTCategory - it is fully internal class in this context. If my understanding and propositions is right we will move forward. |