Exemple #1
0
void 
TraceLog::createModule  (const String& moduleName, const String& path, int level)
{
	Poco::FormattingChannel* pFCFile = new Poco::FormattingChannel(new Poco::PatternFormatter("%Y-%m-%d %H:%M:%S.%c %N[%P]:%s:%p:%t"));
	pFCFile->setChannel(new Poco::FileChannel(path.getCStr()));
	pFCFile->open();
	
	Poco::Logger& fileLogger = Poco::Logger::create(moduleName.getCStr(), pFCFile, level);
}
Exemple #2
0
void
TraceLog::createConsoleLogger(int level)
{
	if (Poco::Logger::has("console") == NULL) {
		// set up two channel chains - one to the
		// console and the other one to a log file.
		Poco::FormattingChannel* pFCConsole = new Poco::FormattingChannel(new Poco::PatternFormatter("%Y-%m-%d %H:%M:%S.%c %N[%P]:%s:%p:%t"));
		pFCConsole->setChannel(new Poco::ConsoleChannel);
		pFCConsole->open();
		
		Poco::Logger& consoleLogger = Poco::Logger::create("console", pFCConsole, level);	
	}
}