示例#1
0
文件: log.cpp 项目: MangoCats/winglib
oexBOOL CLog::OpenLogFile( oexCSTR x_pPath, oexCSTR x_pFile, oexCSTR x_pExtension )
{_STT();
	CStr sFile;

	if ( oexCHECK_PTR( x_pPath ) && *x_pPath )
		sFile = x_pPath;
	else
		sFile = oexGetModulePath();

	if ( oexCHECK_PTR( x_pFile ) && *x_pFile )
		sFile.BuildPath( x_pFile );
	else
		sFile.BuildPath( oexGetModuleFileName().GetFileName() );

	if ( oexCHECK_PTR( x_pExtension ) && *x_pExtension )
		sFile << x_pExtension;
	else
#if defined( OEX_WINCE )
		sFile << oexT( ".debug.log.txt" );
#else
		sFile << oexT( ".debug.log" );
#endif

	return Open( sFile.Ptr() );
}