[RCF::Logging] How logging to StdOut and File ?
Posted: Sat Nov 23, 2013 7:42 am
Logging to StdOut only:
It's work fine.
Logging to File only:
String "Server started!" not logged!
How logging to StdOut and File together?
Code: Select all
#define MYLOGFMT "%C (%D) %X"
#define MYLOGNAME 8
#define RCFLOG3() UTIL_LOG(MYLOGNAME, RCF::LogLevel_3) << "[MyLog] "
std::string myLogFormat = MYLOGFMT;
RCF::enableLogging(RCF::LogToStdout(), 3, myLogFormat);
RCF::LoggerPtr myLogPtr(new RCF::Logger(MYLOGNAME, 3, RCF::LogToStdout(), myLogFormat));
myLogPtr->activate();
RCFLOG3() << "Server started!";
Logging to File only:
Code: Select all
#define MYLOGFMT "%C (%D) %X"
#define MYLOGNAME 8
#define RCFLOG3() UTIL_LOG(MYLOGNAME, RCF::LogLevel_3) << "[MyLog] "
std::string myLogFormat = MYLOGFMT;
RCF::enableLogging(RCF::LogToFile("srv.log"), 3, myLogFormat);
RCF::LoggerPtr myLogPtr(new RCF::Logger(MYLOGNAME, 3, RCF::LogToFile("srv.log"), myLogFormat));
myLogPtr->activate();
RCFLOG3() << "Server started!";
How logging to StdOut and File together?