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


C++ LOG__函数代码示例

本文整理汇总了C++中LOG__函数的典型用法代码示例。如果您正苦于以下问题:C++ LOG__函数的具体用法?C++ LOG__怎么用?C++ LOG__使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LOG__函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _T

BOOL SessionLayout::_DisplayMsgToIE(IN MessageEntity msg)
{
	CString jsInterface = _T("sendMessage");
	module::UserInfoEntity userInfo;
	if (!module::getUserListModule()->getUserInfoBySId(msg.talkerSid, userInfo))
	{
		return FALSE;
	}

	Json::Value root;
	root["name"] = util::cStringToString(userInfo.getRealName());
	root["avatar"] = userInfo.getAvatarPathWithoutOnlineState();
	root["msgtype"] = msg.msgRenderType;
	root["uuid"] = msg.talkerSid;
	root["mtype"] = msg.isMySendMsg() ? "me" : "other";
	CTime timeData(msg.msgTime);
	root["time"] = util::cStringToString(timeData.Format(_T("%Y-%m-%d %H:%M:%S")));

	//语音内容特殊处理
	if (MESSAGE_RENDERTYPE_AUDIO == msg.msgRenderType)
	{
		root["voiceid"] = msg.content;
		CString sVoicetime;
		sVoicetime.Format(_T("%d秒"), msg.msgAudioTime);
		root["voicetime"] = util::cStringToString(sVoicetime);
		root["voiceisread"] = msg.msgAudioReaded ? std::string("true") : string("false");
	}
	else
	{
		CString csContent = util::stringToCString(msg.content);
		ReceiveMsgManage::getInstance()->parseContent(csContent, FALSE, GetWidth());
		std::string content = util::cStringToString(csContent);
		root["content"] = content;
	}
	Json::StyledWriter styleWrite;
	std::string record = styleWrite.write(root);
	Json::Reader jsonRead;
	Json::Value rootRead;
	CString jsData = _T("[]");
	if (!jsonRead.parse(record, rootRead) || rootRead.isNull())
	{
		CString csError = util::stringToCString(record, CP_UTF8);
		LOG__(APP, _T("json parse error:%s"), csError);
		jsData = _T("[]");
		return FALSE;
	}
	else
		jsData = util::stringToCString(record, CP_UTF8);
	//调用页面的JS代码
	if (m_pWebBrowser)
	{
		VARIANT VarResult;
		if (!m_pWebBrowser->CallJScript(jsInterface.GetBuffer(), jsData.GetBuffer(), &VarResult))
		{
			LOG__(ERR, _T("CallJScript failed:%s"),jsData);
		}
		jsData.ReleaseBuffer();
	}
	return TRUE;
}
开发者ID:1072258106,项目名称:TeamTalk,代码行数:60,代码来源:SessionLayout_Function.cpp

示例2: LOG__

void FileTransferSocket::_fileLoginResponse(IN std::string& body)
{
	IM::File::IMFileLoginRsp imFileLoginRsp;
    if (!imFileLoginRsp.ParseFromString(body))
    {
        LOG__(ERR, _T("parse failed,body:%s"), util::stringToCString(body));
        return;
    }
	if (imFileLoginRsp.result_code() != 0)
	{
		LOG__(ERR, _T("file server login failed! "));
		return;
	}
	//打开文件
	std::string taskId = imFileLoginRsp.task_id();
	TransferFileEntity fileEntity;
	if (!TransferFileEntityManager::getInstance()->getFileInfoByTaskId(taskId, fileEntity))
	{
		LOG__(ERR, _T("file server login:can't find the fileInfo "));
		return;
	}

	LOG__(APP, _T("IMFileLoginRsp, file server login succeed"));
	//提示界面,界面上插入该项
	if (IM::BaseDefine::ClientFileRole::CLIENT_REALTIME_SENDER == fileEntity.nClientMode
		|| IM::BaseDefine::ClientFileRole::CLIENT_OFFLINE_UPLOAD == fileEntity.nClientMode)
	{
		module::getFileTransferModule()->asynNotifyObserver(module::KEY_FILETRANSFER_SENDFILE, fileEntity.sTaskID);
	}
	else if (IM::BaseDefine::ClientFileRole::CLIENT_REALTIME_RECVER == fileEntity.nClientMode
		|| IM::BaseDefine::ClientFileRole::CLIENT_OFFLINE_DOWNLOAD == fileEntity.nClientMode)
	{
		module::getFileTransferModule()->asynNotifyObserver(module::KEY_FILETRANSFER_REQUEST, fileEntity.sTaskID);
	}
}
开发者ID:1072258106,项目名称:TeamTalk,代码行数:35,代码来源:FileTransferSocket.cpp

示例3: catch

BOOL DatabaseModule_Impl::_execImMessageCreateTableDML()
{
	try
	{
		m_pSqliteDB->execDML(createImMessageSql.c_str());
		m_pSqliteDB->execDML(createImMessageIndex.c_str());
	}
	catch (CppSQLite3Exception& sqliteException)
	{
		CString csErrMsg = util::stringToCString(sqliteException.errorMessage(), CP_UTF8);
		LOG__(ERR, _T("create table failed,error msg:%s")
			, csErrMsg);
#ifdef _DEBUG
		MessageBoxA(0, sqliteException.errorMessage(), "BD ERROR", MB_OK | MB_ICONHAND);
#endif	
		return FALSE;
	}
	catch (...)
	{
		LOG__(ERR, _T("create table unknown exception"));
		return FALSE;
	}

	return TRUE;
}
开发者ID:0359xiaodong,项目名称:TeamTalk,代码行数:25,代码来源:DatabaseModule_MessageDB_Impl.cpp

示例4: LOG__

void FileTransferModule_Impl::_hasOfflineRes(IN std::string& body)
{
    IM::File::IMFileHasOfflineRsp imFileHasOfflineRsp;
    if (!imFileHasOfflineRsp.ParseFromString(body))
    {
        LOG__(ERR, _T("parse failed,body:%s"), util::stringToCString(body));
        return;
    }

    UINT32 nFileNum = imFileHasOfflineRsp.offline_file_list_size();
    for (UINT32 i = nFileNum; i > 0; --i)
    {
        const IM::BaseDefine::OfflineFileInfo& offLineInfo = imFileHasOfflineRsp.offline_file_list(i - 1);
        TransferFileEntity fileInfo;
        fileInfo.sFromID = util::uint32ToString(offLineInfo.from_user_id());
        fileInfo.sToID = module::getSysConfigModule()->userID();
        fileInfo.nFileSize = offLineInfo.file_size();
        fileInfo.sTaskID = offLineInfo.task_id();
        fileInfo.sFileName = offLineInfo.file_name();
        fileInfo.nClientMode = IM::BaseDefine::ClientFileRole::CLIENT_OFFLINE_DOWNLOAD;
        const IM::BaseDefine::IpAddr& ipAdd = offLineInfo.ip_addr_list(0);
        fileInfo.sIP = ipAdd.ip();
        fileInfo.nPort = ipAdd.port();
        fileInfo.time = static_cast<UInt32>(time(0));
        if (TransferFileEntityManager::getInstance()->pushTransferFileEntity(fileInfo))
        {
            LOG__(APP, _T("离线文件 sFileID = %s"), util::stringToCString(fileInfo.sTaskID));
            TransferFileEntityManager::getInstance()->openFileSocketByTaskId(fileInfo.sTaskID);
        }
    }
}
开发者ID:hlyces,项目名称:teamtalk_TT,代码行数:31,代码来源:FileTransferModule_Impl.cpp

示例5: LOG__

void SessionLayout::_AsynSendReadAck(IN MessageEntity& msg)
{
	if (MESSAGE_RENDERTYPE_SYSTEMTIPS == msg.msgRenderType
		|| MESSAGE_RENDERTYPE_FILETRANSFER == msg.msgRenderType)
	{
		LOG__(APP, _T("not send read ack msgRenderType:%d"),msg.msgRenderType);
		return;
	}
	if (MESSAGE_TYPE_HISTORY == msg.msgStatusType
		|| MESSAGE_TYPE_NONE == msg.msgStatusType)
	{
		LOG__(APP, _T("Not runtime or offline msgStatusType:%d,msgId:%d"), msg.msgStatusType,msg.msgId);
		return;
	}
	imcore::IMLibCoreStartOperationWithLambda(
		[=]()mutable
	{
		std::string OriginSessionId = msg.getOriginSessionId();
		IM::Message::IMMsgDataReadAck imMsgDataReadAck;
		imMsgDataReadAck.set_user_id(module::getSysConfigModule()->userId());
		imMsgDataReadAck.set_session_id(util::stringToInt32(OriginSessionId));
		imMsgDataReadAck.set_msg_id(msg.msgId);
		imMsgDataReadAck.set_session_type(static_cast<IM::BaseDefine::SessionType>(msg.msgSessionType));
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::SID_MSG, IM::BaseDefine::CID_MSG_READ_ACK, &imMsgDataReadAck);
    },0, imcore::OPERATION_NAME_MSG_READ_ACK
	);
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:27,代码来源:SessionLayout.cpp

示例6: lock

void ReceiveMsgManage::removeAllMessage()
{
	CAutoLock lock(&m_lock);
	//记录下程序退出时所有的消息列表,并且记录下来,这个会成为离线消息
	SessionMessageMap::iterator iterMap = m_mapSessionMsg.begin();
	LOG__(ERR, _T("MessageMananger unread message trace begin:"));
	for (; iterMap != m_mapSessionMsg.end(); ++iterMap)
	{
		SessionMessage_List msgList;
		if (popMessagesBySId(iterMap->first, msgList))
		{
			SessionMessage_List::iterator iter = msgList.begin();
			for (; iter != msgList.end(); ++iter)
			{
				MessageEntity& msg = *iter;
				CString csUId = util::stringToCString(msg.talkerSid);
				CString csCnt = util::stringToCString(msg.content, CP_UTF8);
				CTime time(msg.msgTime);
				CString csTime = time.Format(_T("%Y-%m-%d %H:%M:%S"));
				LOG__(DEBG, _T("time:%s id:%s,content:%s"), csTime, csUId, csCnt);
			}
		}
	}
	LOG__(DEBG, _T("MessageMananger unread message trace end"));
	m_mapSessionMsg.clear();
}
开发者ID:hlyces,项目名称:teamtalk_TT,代码行数:26,代码来源:ReceiveMsgManage.cpp

示例7: LOG__

void MainListLayout::_UpdateRecentSessionItem(IN const std::string& sessionId, IN const UInt32 sessionType)
{
	SessionListItemInfo item;
	item.folder = false;
	item.empty = false;
	if (IM::BaseDefine::SessionType::SESSION_TYPE_GROUP == static_cast<IM::BaseDefine::SessionType>(sessionType))
	{
		module::GroupInfoEntity groupInfo;
		if (!module::getGroupListModule()->getGroupInfoBySId(sessionId, groupInfo))
		{
			LOG__(ERR, _T("Can't get the groupInfo, groupId = %s"), util::stringToCString(sessionId));
			return;
		}
		item.id = util::stringToCString(groupInfo.gId);
		item.avatarPath = util::stringToCString(groupInfo.getAvatarPath());
		item.nickName = groupInfo.csName;
		m_UIRecentConnectedList->UpdateItemInfo(item);
	}
	else if (IM::BaseDefine::SessionType::SESSION_TYPE_SINGLE == static_cast<IM::BaseDefine::SessionType>(sessionType))
	{
		module::UserInfoEntity userInfo;
		if (!module::getUserListModule()->getUserInfoBySId(sessionId, userInfo))
		{
			LOG__(ERR, _T("Can't get the userInfo, userId = %s"), util::stringToCString(sessionId));
			return;
		}
		item.id = util::stringToCString(userInfo.sId);
		item.avatarPath = util::stringToCString(userInfo.getAvatarPath());
		item.nickName = userInfo.getRealName();
		m_UIRecentConnectedList->UpdateItemInfo(item);
	}
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:32,代码来源:MainListLayout.cpp

示例8: catch

BOOL DatabaseModule_Impl::sqlDeleteGroupInfoEntity(IN const std::string& groupId)
{
	try
	{
		CppSQLite3Statement stmt = m_pSqliteDB->compileStatement(deleteGroupInfoSql.c_str());
		stmt.bind(1, groupId.c_str());
		stmt.execDML();
	}
	catch (CppSQLite3Exception& sqliteException)
	{
#ifdef _DEBUG
		MessageBoxA(0, sqliteException.errorMessage(), "BD ERROR", MB_OK | MB_ICONHAND);
#endif
		CString csErrMsg = util::stringToCString(sqliteException.errorMessage(), CP_UTF8);
		LOG__(ERR, _T("delete failed,error msg:%s"), csErrMsg);
		return FALSE;
	}
	catch (...)
	{
		LOG__(ERR, _T("db unknown exception"));
		return FALSE;
	}

	return TRUE;
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:25,代码来源:DatabaseModule_GroupInfoDB_Impl.cpp

示例9: int

BOOL DatabaseModule_Impl::sqlInsertOrReplaceGroupInfoEntity(IN const module::GroupInfoEntity& groupInfo)
{
	try
	{
		CppSQLite3Statement stmt = m_pSqliteDB->compileStatement(insertGroupInfoSql.c_str());
		stmt.bind(1, groupInfo.gId.c_str());
		stmt.bind(2, util::cStringToString(groupInfo.csName).c_str());
		stmt.bind(3, util::cStringToString(groupInfo.desc).c_str());
		stmt.bind(4, groupInfo.avatarUrl.c_str());
		stmt.bind(5, groupInfo.creatorId.c_str());
		stmt.bind(6, int(groupInfo.type));
		stmt.bind(7, int(groupInfo.version));
		stmt.bind(8, int(groupInfo.groupUpdated));
		stmt.bind(9, int(groupInfo.shieldStatus));
		std::string& strJson = _makeJsonForGroupMembers(groupInfo.groupMemeberList);
		stmt.bind(10, strJson.c_str());
		stmt.execDML();
	}
	catch (CppSQLite3Exception& sqliteException)
	{
#ifdef _DEBUG
		MessageBoxA(0, sqliteException.errorMessage(), "BD ERROR", MB_OK | MB_ICONHAND);
#endif
		CString csErrMsg = util::stringToCString(sqliteException.errorMessage(), CP_UTF8);
		LOG__(ERR, _T("insert failed,error msg:%s"), csErrMsg);
		return FALSE;
	}
	catch (...)
	{
		LOG__(ERR, _T("db unknown exception"));
		return FALSE;
	}

	return TRUE;
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:35,代码来源:DatabaseModule_GroupInfoDB_Impl.cpp

示例10: LOG__

void DatabaseModule_Impl::_parseJsonForGroupMembers(IN std::string strJson, OUT std::list<std::string>& groupMemeberList)
{
	Json::Reader reader;
	Json::Value root;

	try
	{
		if (reader.parse(strJson, root) || root.isNull())
		{
			const Json::Value arrayObj = root["UserIds"];
			for (int i = 0; i < static_cast<int>(arrayObj.size()); ++i)
			{
				groupMemeberList.push_back(arrayObj[i].asString());
			}
		}
		else
		{
			LOG__(ERR, _T("json parse falied! json data:%s"),util::stringToCString(strJson));
		}
	}
	catch (...)
	{
		LOG__(ERR, _T("json parse falied! json data:%s"), util::stringToCString(strJson));
	}
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:25,代码来源:DatabaseModule_GroupInfoDB_Impl.cpp

示例11: LOG__

// -----------------------------------------------------------------------------
// private   
void ReloginManager::doRelogin()
{
    try
    {
        if(m_bDoReloginNow)
        {
            LOG__(APP,_T("is doing Relogin now..."));
            return;
        }

        //清理掉队列里面 未发送的 消息已读确认 Operation《不处理可能会引发丢消息》
        imcore::IMLibCoreClearOperationByName(imcore::OPERATION_NAME_MSG_READ_ACK);

        LoginParam param;
		module::TTConfig* pCfg = module::getSysConfigModule()->getSystemConfig();
		param.mySelectedStatus = pCfg->myselectStatus;
		param.csUserName = pCfg->userName;
		param.password = pCfg->password;
		param.csUserName.Trim();

		LoginOperation* pOperation = new LoginOperation(BIND_CALLBACK_1(ReloginManager::OnOperationCallback), param);
		imcore::IMLibCoreStartOperation(pOperation);
        m_bDoReloginNow = TRUE;
    }
    catch (...)
    {
		module::getTcpClientModule()->shutdown();
        startReloginTimer(++m_secondCount);
        LOG__(ERR, _T("relogin unknown exception"));
        m_bDoReloginNow = FALSE;
    }
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:34,代码来源:ReloginManager.cpp

示例12: LOG__

BOOL ReceiveMsgManage::pushMessageBySId(const std::string& sId, MessageEntity& msg)
{
	if (sId.empty())
	{
		LOG__(ERR, _T("sId is empty!"));
		return FALSE;
	}
	CAutoLock lock(&m_lock);
	try
	{
		SessionMessage_List* listChatMsg = _getChatMsgListBySID(sId);
		if (listChatMsg)
		{
			listChatMsg->push_back(msg);
		}
		else
		{
			SessionMessage_List listChatMsg2;
			listChatMsg2.push_back(msg);
			m_mapSessionMsg[sId] = listChatMsg2;
		}
	}
	catch (...)
	{
		CString csSid = util::stringToCString(sId);
		CString csMsgCnt = util::stringToCString(msg.content, CP_UTF8);
		LOG__(ERR, _T("pushMessageBySId failed,SId:%s,msg conteng:%s"), csSid, csMsgCnt);
		return FALSE;
	}
	return TRUE;
}
开发者ID:hlyces,项目名称:teamtalk_TT,代码行数:31,代码来源:ReceiveMsgManage.cpp

示例13: LOG__

void LoginModule_Impl::notifyLoginDone()
{
	imcore::IMLibCoreStartOperationWithLambda(
		[]
	{
		//鑾峰彇閮ㄩ棬淇℃伅
		UInt32 lastTime = module::getSysConfigModule()->getDepartmentInfoLatestUpdateTime();
		IM::Buddy::IMDepartmentReq imDepartmentReq;
		imDepartmentReq.set_user_id(module::getSysConfigModule()->userId());
		imDepartmentReq.set_latest_update_time(lastTime);
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::SID_BUDDY_LIST
			, IM::BaseDefine::BuddyListCmdID::CID_BUDDY_LIST_DEPARTMENT_REQUEST
			, &imDepartmentReq);
		LOG__(APP, _T("IMDepartmentReq,latest update time :%d"), lastTime);

		//澧為噺鑾峰彇鎵�鏈変汉淇℃伅
		lastTime = module::getSysConfigModule()->getUserInfoLatestUpdateTime();//鑾峰彇鏈�鍚庝竴娆℃洿鏂颁汉鍛樹俊鎭殑鏃堕棿
		IM::Buddy::IMAllUserReq imAllUserReq;
		imAllUserReq.set_user_id(module::getSysConfigModule()->userId());
		imAllUserReq.set_latest_update_time(lastTime);
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::SID_BUDDY_LIST
			, IM::BaseDefine::BuddyListCmdID::CID_BUDDY_LIST_ALL_USER_REQUEST
			,&imAllUserReq);
		LOG__(APP, _T("IMAllUserReq,latest update time :%d"), lastTime);

		//澧為噺鑾峰彇缇ゅ垪琛�
		IM::Group::IMNormalGroupListReq imNormalGroupListReq;
		imNormalGroupListReq.set_user_id(module::getSysConfigModule()->userId());
		module::getTcpClientModule()->sendPacket(IM::BaseDefine::ServiceID::SID_GROUP
			, IM::BaseDefine::GroupCmdID::CID_GROUP_NORMAL_LIST_REQUEST
			, &imNormalGroupListReq);
		LOG__(APP, _T("IMNormalGroupListReq"));
	});
}
开发者ID:shaozhipeng,项目名称:TeamTalk,代码行数:34,代码来源:LoginModule_Impl.cpp

示例14: int

BOOL DatabaseModule_Impl::sqlUpdateRecentSessionInfoEntity(IN const module::SessionEntity& sessionInfo)
{
	try
	{
		CppSQLite3Statement stmt = m_pSqliteDB->compileStatement(updateRecentSessionByIdSql.c_str());
		stmt.bind(1, sessionInfo.sessionID.c_str());
		stmt.bind(2, int(sessionInfo.sessionType));
		stmt.bind(3, int(sessionInfo.updatedTime));
		stmt.bind(4, int(sessionInfo.latestmsgId));
		stmt.bind(5, sessionInfo.latestMsgContent.c_str());
		stmt.bind(6, sessionInfo.latestMsgFromId.c_str());

		stmt.bind(7, sessionInfo.sessionID.c_str());
		int countUpdate = stmt.execDML();
		if (0 == countUpdate)
		{
			return FALSE;
		}
	}
	catch (CppSQLite3Exception& sqliteException)
	{
#ifdef _DEBUG
		MessageBoxA(0, sqliteException.errorMessage(), "BD ERROR", MB_OK | MB_ICONHAND);
#endif
		CString csErrMsg = util::stringToCString(sqliteException.errorMessage(), CP_UTF8);
		LOG__(ERR, _T("db failed,error msg:%s"), csErrMsg);
		return FALSE;
	}
	catch (...)
	{
		LOG__(ERR, _T("db unknown exception"));
		return FALSE;
	}
	return TRUE;
}
开发者ID:hgl888,项目名称:TeamTalk,代码行数:35,代码来源:DatabaseModule_RecentSessionDB_Impl.cpp

示例15: _T

BOOL DatabaseModule_Impl::_startup()
{
	try
	{
		CString dbPathTemp = module::getMiscModule()->getTTCommonAppdataUserDir();
		util::createAllDirectories(dbPathTemp);
		module::TTConfig* pCfg = module::getSysConfigModule()->getSystemConfig();
		if (pCfg->csUserId.IsEmpty())
			return FALSE;
		CString dbPath = dbPathTemp + _T("\\") + pCfg->csUserId + _T(".db");
		dbPathTemp = module::getMiscModule()->getTTCommonAppdata();
		CString globalDBPath = dbPathTemp + _T("\\global.db");
		m_sDBPath = util::cStringToString(dbPath);
		m_sGlobalDBPath = util::cStringToString(globalDBPath);
		if (!_openDB())
		{
			LOG__(ERR, _T("open db failed"));
			return FALSE;
		}
	}
	catch (...)
	{
		LOG__(ERR, _T("unknown exception"));
		return FALSE;
	}

	return TRUE;
}
开发者ID:1072258106,项目名称:TeamTalk,代码行数:28,代码来源:DatabaseModule_Impl.cpp


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