From: S R. <kiw...@ma...> - 2009-11-03 22:13:46
|
On Oct 26, 2009, at 13:35 , S Roderick wrote: > On Oct 26, 2009, at 13:09 , Konstantin Litvinenko wrote: > >> On 26.10.2009 15:43, S Roderick wrote: >> [.........huge skip.........] >> Roderick, I understand all your wishes and can propose followed >> solution: >> >> 1. We add ability to set up creator for categories in >> HierarchyMaintainer >> 2. You write you own RTCategory that derived from log4cpp Category >> and meet all your requirements - >> you hide from usage all functions that receive std::strings and >> expose those that receive rt_strings. >> 3. To use log4cpp in usual manner user should setup default creator >> as RTCategory creator and do >> following when obtaining reference on RTCategory: >> >> class foo >> { >> public: >> foo() : >> logger_ >> (static_cast<RTCategory&>(log4cpp::Category::getInstance("foo"))) >> { >> } >> >> private: >> RTCategory& logger_; >> }; >> >> Please, comment this. > > This all sounds reasonable, but let me look at it some more. > >> As for rt allocator in HierarchyMaintainer that is really hard and >> likely impossible, because I >> don't know how to rewrite HierarchyMaintainer::_getInstance in a way >> that it become rt. It uses >> std::string and I see no way how to avoid std::string creation... > > Fair enough. > > Thanks! > Stephen How do the two attached patches look to you? The first patch provides 1) above, while the second patch is needed for some of the other points. Let me know what you think and what you would like to see changed. Thanks Stephen |