当前位置: 首页>>代码示例>>C++>>正文


C++ CLog::addDisplayer方法代码示例

本文整理汇总了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;
}
开发者ID:mixxit,项目名称:solinia,代码行数:41,代码来源:extract_warnings.cpp

示例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
开发者ID:Kiddinglife,项目名称:ryzom,代码行数:27,代码来源:tick_proxy.cpp


注:本文中的nlmisc::CLog::addDisplayer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。