예제 #1
0
//++
//------------------------------------------------------------------------------------
// Details: CMICmnLogMediumFile constructor.
// Type:    Method.
// Args:    None.
// Return:  None.
// Throws:  None.
//--
CMICmnLogMediumFile::CMICmnLogMediumFile()
    : m_constThisMediumName(MIRSRC(IDS_MEDIUMFILE_NAME)),
      m_constMediumFileNameFormat("lldb-mi-%s.log"),
      m_strMediumFileName(MIRSRC(IDS_MEDIUMFILE_ERR_INVALID_PATH)),
      m_strMediumFileDirectory("."),
      m_fileNamePath(MIRSRC(IDS_MEDIUMFILE_ERR_INVALID_PATH)),
      m_eVerbosityType(CMICmnLog::eLogVerbosity_Log),
      m_strDate(CMIUtilDateTimeStd().GetDate()),
      m_fileHeaderTxt(MIRSRC(IDS_MEDIUMFILE_ERR_FILE_HEADER)) {}
예제 #2
0
//++ ------------------------------------------------------------------------------------
// Details:	Massage the data to behave correct when submitted to file. Insert extra log
//			specific text. The veType is there to allow in the future to parse the log and
//			filter in out specific types of message to make viewing the log more manageable.
// Type:	Method.
// Args:	vData	- (R) Raw data.
//			veType	- (R) Message type.
// Return:	CMIUtilString - Massaged data.
// Throws:	None.
//--
CMIUtilString CMICmnLogMediumFile::MassagedData( const CMIUtilString & vData, const CMICmnLog::ELogVerbosity veType )
{
	const CMIUtilString strCr( "\n" );
	CMIUtilString data;
	const MIchar verbosityCode( ConvertLogVerbosityTypeToId( veType ) );
	const CMIUtilString dt( CMIUtilString::Format( "%s %s", m_strDate.c_str(), CMIUtilDateTimeStd().GetTime().c_str() ) );
	
	data = CMIUtilString::Format( "%c,%s,%s", verbosityCode, dt.c_str(), vData.c_str() );
	data = ConvertCr( data );

	// Look for EOL...
	const MIint pos = vData.rfind( strCr );
	if( pos == (MIint) vData.size() )
		return data;
	
	// ... did not have an EOL so add one
	data += GetLineReturn();
	
	return data;
}