本文整理汇总了C++中nlmisc::CLog::addDisplayer方法的典型用法代码示例。如果您正苦于以下问题:C++ CLog::addDisplayer方法的具体用法?C++ CLog::addDisplayer怎么用?C++ CLog::addDisplayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nlmisc::CLog
的用法示例。
在下文中一共展示了CLog::addDisplayer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doAnalyse
LOG_ANALYSER_PLUGIN_API bool doAnalyse( const std::vector<const char *>& vec, std::string& res, std::string& log )
{
// ---
// Optional: Demo of how to get NeL logs (1/2)
// Outside this function, include <nel/misc/debug.h> and use namespace NLMISC.
//NLMISC::createDebug();
//CMemDisplayer memdisp;
//NLMISC::DebugLog->addDisplayer( &memdisp );
//NLMISC::InfoLog->addDisplayer( &memdisp );
//NLMISC::WarningLog->addDisplayer( &memdisp );
// ErrorLog and AssertLog not needed, they stop the application.
// ---
// Analyse warnings from vec
CLogReport MainLogReport;
MainLogReport.reset();
int nb = 0;
string line;
vector<const char *>::const_iterator iv;
for ( iv=vec.begin(); iv!=vec.end(); ++iv )
{
line = string(*iv);
MainLogReport.pushLine( line );
}
log = "Log report done.\nUse Right-Click > Select All then Copy (Ctrl+C) to copy the report from the top window.\n \n";
// Fill report to res
NLMISC::CLightMemDisplayer disp;
NLMISC::CLog reportLog;
reportLog.addDisplayer( &disp );
MainLogReport.report( &reportLog, true );
disp.write( res, true );
disp.write( log, false );
// ---
// Optional: Demo of how to get all NeL logs (2/2)
//memdisp.write( log );
// ---
return true;
}
示例2: init
//--------------------------------------------------------------
// init
//
//--------------------------------------------------------------
void CTickProxy::init( void (*updateFunc)(),
void (*syncFunc)() )
{
// set the callbacks
onTick = updateFunc;
onSync = syncFunc;
nlassert( updateFunc );
nlassert( syncFunc );
// Hide tick messages to avoid flooding
DebugLog->addNegativeFilter ("TICK");
DebugLog->addNegativeFilter ("TOCK");
DebugLog->addNegativeFilter ("14+5");
CUnifiedNetwork::getInstance()->addCallbackArray(cbTickProxyArray,sizeof(cbTickProxyArray)/sizeof(cbTickProxyArray[0]));
CUnifiedNetwork::getInstance()->setServiceUpCallback ("TICKS", cbTPTicksUp, NULL);
CUnifiedNetwork::getInstance()->setServiceDownCallback ("TICKS", cbTPTicksDown, NULL);
RecentHistory.setParam( 100 );
_QuickLog.addDisplayer( &RecentHistory, false );
} // init