From: Konstantin L. <Kon...@ma...> - 2008-05-21 05:35:32
|
Hello, Andy! You wrote to <log...@li...> on Mon, 19 May 2008 20:38:37 +0800: A> after I call init(), then I write this: A> loggg.debug(" Hello, log4cpp!"); On Windows this code works as expected #include <log4cpp/Category.hh> #include <log4cpp/PropertyConfigurator.hh> #include <iostream> log4cpp::Category& loggg = log4cpp::Category::getInstance(std::string("mylog")); void init() { try { log4cpp::PropertyConfigurator::configure("log4cpp.properties"); } catch (log4cpp::ConfigureFailure & f) { std::cerr << "configure problem " << f.what() << std::endl; } } int main() { init(); loggg.debug(" Hello, log4cpp!"); return 0; } Print out: 2008-05-21 08:30:38,718 [DEBUG][3476] : Hello, log4cpp! 2008-05-21 08:30:38,718 [DEBUG][3476] : Hello, log4cpp! What log4cpp version, compiler version, OS do you use? With best regards, Konstantin Litvinenko. |