• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LogString函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: MyOpenClipboard

bool MyOpenClipboard(LPCWSTR asAction)
{
	_ASSERTE(gnMyClipboardOpened==0 || gnMyClipboardOpened==1);

	if (gnMyClipboardOpened > 0)
	{
		InterlockedIncrement(&gnMyClipboardOpened);
		return true;
	}

	BOOL lbRc;
	int iMaxTries = 100;

	// Open Windows' clipboard
	while (!(lbRc = OpenClipboard((ghWnd && IsWindow(ghWnd)) ? ghWnd : NULL)) && (iMaxTries-- > 0))
	{
		DWORD dwErr = GetLastError();

		wchar_t szCode[32]; _wsprintf(szCode, SKIPCOUNT(szCode) L", Code=%u", dwErr);
		wchar_t* pszMsg = lstrmerge(L"OpenClipboard failed (", asAction, L")", szCode);
		LogString(pszMsg);
		int iBtn = DisplayLastError(pszMsg, dwErr, MB_RETRYCANCEL|MB_ICONSTOP);
		SafeFree(pszMsg);

		if (iBtn != IDRETRY)
			return false;
	}

	InterlockedIncrement(&gnMyClipboardOpened);
	_ASSERTE(gnMyClipboardOpened==1);

	LogString(L"OpenClipboard succeeded");
	return true;
}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:34,代码来源:MyClipboard.cpp


示例2: dreamSock_SendPacket

//-----------------------------------------------------------------------------
// Name: empty()
// Desc: 
//-----------------------------------------------------------------------------
void dreamSock_SendPacket(SOCKET sock, int length, char *data, struct sockaddr addr)
{
	int	ret;

	ret = sendto(sock, data, length, 0, &addr, sizeof(addr));

	if(ret == -1)
	{
#ifdef WIN32
		errno = WSAGetLastError();

		// Silently handle wouldblock
		if(errno == WSAEWOULDBLOCK)
			return;

		LogString("Error code %d: sendto() : %s", errno, strerror(errno));
#else
		// Silently handle wouldblock
		if(errno == EWOULDBLOCK)
			return;

		LogString("Error code %d: sendto() : %s", errno, strerror(errno));
#endif
	}
}
开发者ID:jbreslin33,项目名称:breslingame,代码行数:29,代码来源:dreamSockGlobal.cpp


示例3: dreamSock_Socket

//-----------------------------------------------------------------------------
// Name: empty()
// Desc: 
//-----------------------------------------------------------------------------
SOCKET dreamSock_Socket(int protocol)
{
	int type;
	int proto;
	SOCKET sock;

	// Check which protocol to use
	if(protocol == DREAMSOCK_TCP)
	{
		type = SOCK_STREAM;
		proto = IPPROTO_TCP;
	}
	else
	{
		type = SOCK_DGRAM;
		proto = IPPROTO_UDP;
	}

	// Create the socket
	if((sock = socket(AF_INET, type, proto)) == -1)
	{
		LogString("dreamSock_Socket - socket() failed");

#ifdef WIN32
		errno = WSAGetLastError();
		LogString("Error: socket() code %d : %s", errno, strerror(errno));
#else
		LogString("Error: socket() : %s", strerror(errno));
#endif

		return DREAMSOCK_INVALID_SOCKET;
	}

	return sock;
}
开发者ID:jbreslin33,项目名称:breslingame,代码行数:39,代码来源:dreamSockGlobal.cpp


示例4: LogString

int ServerSideNetworkedGame::InitNetwork()
{
	if(dreamSock_Initialize() != 0)
	{
		LogString("Error initialising Communication Library!");
		return 1;
	}

	LogString("Initialising game");

	// Create the game servers on new ports, starting from 30004
	int ret = networkServer->Initialise("", 30004);

	if(ret == DREAMSOCK_SERVER_ERROR)
	{
#ifdef WIN32
		char text[64];
		sprintf(text, "Could not open server on port %d", networkServer->GetPort());

		MessageBox(NULL, text, "Error", MB_OK);
#else
		LogString("Could not open server on port %d", networkServer->GetPort());
#endif
		return 1;
	}

	return 0;
}
开发者ID:jbreslin33,项目名称:breslinservergame,代码行数:28,代码来源:serverSideNetworkedGame.cpp


示例5: sizeof

HWND CConEmuInside::CheckInsideFocus()
{
	if (!isInsideWndSet())
	{
		//_ASSERTE(FALSE && "Inside was not initialized");
		return NULL;
	}

	wchar_t szInfo[512];
	GUITHREADINFO tif = { sizeof(tif) };
	HWND hParentWnd = GetParentRoot();
	DWORD nTID = GetWindowThreadProcessId(hParentWnd, NULL);

	if (!GetGUIThreadInfo(nTID, &tif))
	{
		_wsprintf(szInfo, SKIPCOUNT(szInfo) L"GetGUIThreadInfo(%u) failed, code=%u", nTID, GetLastError());
		LogString(szInfo);
		return NULL;
	}

	static GUITHREADINFO last_tif = {};
	if (memcmp(&last_tif, &tif, sizeof(tif)) != 0)
	{
		last_tif = tif;

		_wsprintf(szInfo, SKIPCOUNT(szInfo)
			L"ParentInputInfo: flags=x%X Active=x%X Focus=x%X Capture=x%X Menu=x%X MoveSize=x%X Caret=x%X (%i,%i)-(%i,%i)",
			tif.flags, LODWORD(tif.hwndActive), LODWORD(tif.hwndFocus), LODWORD(tif.hwndCapture), LODWORD(tif.hwndMenuOwner),
			LODWORD(tif.hwndMoveSize), LODWORD(tif.hwndCaret), LOGRECTCOORDS(tif.rcCaret));
		LogString(szInfo);
	}

	return tif.hwndFocus;
}
开发者ID:2asoft,项目名称:ConEmu,代码行数:34,代码来源:Inside.cpp


示例6: assert


//.........这里部分代码省略.........

	tagHotICON hotICON;

	hotICON.m_cType = CLANSKILL_ICON;
	hotICON.m_nSlotNo = pSkillIcon->GetSkillSlotFromIcon();

	if( hotICON.m_nSlotNo < 0 || hotICON.m_nSlotNo >= MAX_CLAN_SKILL_SLOT  )
	{
		assert( 0 && "Invalid Skill Slot Index @CTCmdDragClanSkill2QuickBar::Exec" );
		return true;
	}

	g_pNet->Send_cli_SET_HOTICON( (BYTE)nQuickSlotIdx, hotICON );
	
	return true;
}


///*------------------------------------------------------------------------------------------------------------*/
bool	CTCmdDragItemFromQuickBar::Exec( CTObject* pObj )
{
	if( pObj == NULL )
	{
		assert( pObj && "Invalid Arg @CTCmdItemFromQuickBar::Exec");	
		return true;
	}
	
	CIconQuick* pIcon = (CIconQuick*)pObj;
	
	short nSlotIndex = pIcon->GetQuickBarSlotIndex();

	if( nSlotIndex < 0 || nSlotIndex >= MAX_HOT_ICONS )
	{
		LogString( LOG_NORMAL,"Not Found SlotIndex By Icon Pointer @CTCmdDragItemFromQuickBar::Exec");
		return true;
	}

	tagHotICON hotICON;

	hotICON.m_cType = 0;
	hotICON.m_nSlotNo = 0;
	g_pNet->Send_cli_SET_HOTICON( (BYTE)nSlotIndex, hotICON );
	return true;
}
///*------------------------------------------------------------------------------------------------------------*/
bool	CTCmdMoveIconInQuickBar::Exec( CTObject* pObj )
{
	if( pObj == NULL )
	{
		assert( pObj && "Invalid Arg @CTCmdItemFromQuickBar::Exec");	
		return true;
	}
	
	CIconQuick* pIcon = (CIconQuick*)pObj;
	
	short nPrevSlotIndex = pIcon->GetQuickBarSlotIndex();

	if( nPrevSlotIndex < 0 || nPrevSlotIndex >= MAX_HOT_ICONS )
	{
		LogString( LOG_NORMAL,"Invalid QuickBar SlotIndex @CTCmdDragItemFromQuickBar::Exec");
		return true;
	}


	CTDialog* pDlg = g_itMGR.FindDlg( m_nType );
	if( pDlg == NULL )
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:67,代码来源:DragCommand.cpp


示例7: LogString

void NetworkedGame::Connect(void)
{
	if(init)
	{
		LogString("ArmyWar already initialised");
		return;
	}

	LogString("PolyNetworkedGame::Connect");

	init = true;

	networkClient->SendConnect("myname");
}
开发者ID:jbreslin33,项目名称:breslingame,代码行数:14,代码来源:networkedGame.cpp


示例8: Cal_RunSPEED

void CObjUSER::Update_SPEED ()
{	
	//Cal_RunSPEED() Add speed to calculate.
	//It turns on after the speed gives m_nRunSPEED value in the server.
	//Another way to compute here. ;;;;
	m_nRunSPEED     = Cal_RunSPEED ();

	if ( this->GetPetMode() < 0 )
	{
 		m_fRunAniSPEED = Cal_RunAniSPEED( m_nRunSPEED );
 		m_nAtkAniSPEED = Cal_AtkAniSPEED( this->GetPartITEM(BODY_PART_WEAPON_R) );
 	} 
	else 
	{
		/// Add Battle Heart attack speed application nAvy - 2005/7/28
#if defined(_GBC)
		m_fRunAniSPEED = ( m_nRunSPEED + 500 ) / 1000.f;
		m_nAtkAniSPEED = Cal_AtkAniSPEED( this->GetPartITEM(BODY_PART_WEAPON_R) );

		/*for( int i = 0 ; i < MAX_RIDING_PART; ++i )
			m_nAtkAniSPEED += PAT_ITEM_ATK_SPD( m_sPetPartItemIDX[ i ].m_nItemNo );*/
#else
 		m_fRunAniSPEED = ( m_nRunSPEED + 500 ) / 1000.f;
 		///<- 2005/7/25 Add to Cart modifying system parts : nAvy
		//m_nAtkAniSPEED = ( 1500.f / ( ( PAT_ITEM_ATK_SPD( m_sPetPartItemIDX[ RIDE_PART_ARMS ].m_nItemNo )) + 5 ) ) + this->m_iAddValue[ AT_ATK_SPD ];
		m_nAtkAniSPEED = ( 1500.f / ( ( PAT_ITEM_ATK_SPD( m_sPetPartItemIDX[ RIDE_PART_ARMS ].m_nItemNo )) + 5 ) ) + this->m_iAddValue[ AT_ATK_SPD ];
		///->
#endif
 	}


	LogString (LOG_DEBUG, "CmPerSEC: %f, AniSpeed: %f \n", m_nRunSPEED, m_fRunAniSPEED );
};
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:33,代码来源:CObjUSER.cpp


示例9: wsprintfW

bool CClientDB::InsertInventoryData( const char* pszName, S_InventoryData Data )
{
	ICommandText*       pICommandText           = NULL;
	HRESULT             hr;
	LONG                cNumRows = 0;

	WCHAR wCmdString[1024];

	wsprintfW(wCmdString, L"INSERT INTO INVENTORY ( name, realindex, virtualindex ) VALUES ( '%S', %d, %d )", pszName, Data.lRealIndex, Data.lVirtualIndex );

	pICommandText = CreateCommand ( m_pIDBInitialize ,wCmdString 	);

	if( pICommandText == NULL )
		return false;

    if(FAILED(hr = pICommandText->Execute(
                                    NULL, 
                                    IID_NULL, 
                                    NULL, 
                                    &cNumRows, 
                                    NULL)))
    {
		LogString( LOG_NORMAL,"Fail CreateInventoryTable\n" );
	}
	pICommandText->Release();
	return true;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:27,代码来源:ClientDB.cpp


示例10: QF_appendQuest

//-------------------------------------------------------------------------------------------------
int		QF_appendQuest ( int iQuestID )
{
	LogString (LOG_DEBUG, "QF_appendQuest( %d ) \n", iQuestID );

	//--------------------------------------------------------------------------------
	LOGOUT( "QF_appendQuest( %d ) ", iQuestID );
	//--------------------------------------------------------------------------------

	for (short nI=0; nI<QUEST_PER_PLAYER; nI++)
		if ( 0 == g_pAVATAR->m_Quests.m_QUEST[ nI ].GetID() ) 
		{
			g_pAVATAR->m_Quests.m_QUEST[ nI ].Init ();
			g_pAVATAR->m_Quests.m_QUEST[ nI ].SetID( iQuestID, true );

			//--------------------------------------------------------------------------------
			LOGOUT( "QF_appendQuest( %d ) [ The request to the server : %d ] ", iQuestID, nI );
			//--------------------------------------------------------------------------------

			g_pNet->Send_cli_QUEST_REQ(TYPE_QUEST_REQ_ADD, (BYTE)nI, iQuestID );
			return nI;
		}

	//--------------------------------------------------------------------------------
	LOGERR( "QF_appendQuest( %d ) FAILED ", iQuestID );
	//--------------------------------------------------------------------------------
	return -1;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:28,代码来源:QF_QUEST.CPP


示例11: INVENTORY

//*----------------------------------------------------------------------------
/// 매번 새로 만들려고 시도한다.. 이미 만들어져 있다면 Fail
//*----------------------------------------------------------------------------
bool CClientDB::CreateInventoryTable()
{
	ICommandText*       pICommandText           = NULL;
	HRESULT             hr;
	LONG                cNumRows = 0;

	WCHAR wCmdString[] = L"CREATE TABLE INVENTORY ( name TEXT(30), realindex long , virtualindex long )";
	
	pICommandText = CreateCommand ( m_pIDBInitialize ,wCmdString 	);

	if( pICommandText == NULL )
		return false;

    if(FAILED(hr = pICommandText->Execute(
                                    NULL, 
                                    IID_NULL, 
                                    NULL, 
                                    &cNumRows, 
                                    NULL)))
    {
		LogString( LOG_NORMAL,"Fail CreateInventoryTable\n" );
	}
	pICommandText->Release();
	return true;
}
开发者ID:PurpleYouko,项目名称:Wibble_Wibble,代码行数:28,代码来源:ClientDB.cpp


示例12: wcscpy_c

void CTabPanelBase::UpdateTabFontInt()
{
	if (!IsTabbarCreated())
		return;

	LOGFONT lf = {};
	lf.lfWeight = FW_DONTCARE;
	lf.lfCharSet = gpSet->nTabFontCharSet;
	lf.lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
	wcscpy_c(lf.lfFaceName, gpSet->sTabFontFace);
	gpFontMgr->EvalLogfontSizes(lf, gpSet->nTabFontHeight, 0);

	wchar_t szInfo[100];
	_wsprintf(szInfo, SKIPCOUNT(szInfo) L"Creating tab font name='%s' height=%i", lf.lfFaceName, lf.lfHeight);
	LogString(szInfo);

	// CreateFont
	HFONT hFont = CreateFontIndirect(&lf);

	// virtual
	SetTabbarFont(hFont);

	// Store new Font in member variable
	if (mh_TabFont)
		DeleteObject(mh_TabFont);
	mh_TabFont = hFont;
}
开发者ID:jslilly,项目名称:ConEmu,代码行数:27,代码来源:TabCtrlBase.cpp


示例13: _ASSERTE

bool CSetPgApps::CreateChildDlg()
{
	if (mh_Child && !IsWindow(mh_Child))
	{
		_ASSERTE(FALSE && "Invalid mh_Child");
		mh_Child = NULL;
	}

	if (!mh_Child)
	{
		#if defined(_DEBUG)
		HWND hChild = GetDlgItem(mh_Dlg, IDD_SPG_APPDISTINCT2);
		_ASSERTE(hChild == NULL);
		#endif

		LogString(L"Creating child dialog IDD_SPG_APPDISTINCT2");
		SafeDelete(mp_DlgDistinct2); // JIC

		mp_DlgDistinct2 = CDynDialog::ShowDialog(IDD_SPG_APPDISTINCT2, mh_Dlg, pageOpProc_AppsChild, 0/*dwInitParam*/);
		mh_Child = mp_DlgDistinct2 ? mp_DlgDistinct2->mh_Dlg : NULL;

		if (!mh_Child)
		{
			EnableWindow(mh_Dlg, FALSE);
			MBoxAssert(mh_Child && "CreateDialogParam(IDD_SPG_APPDISTINCT2) failed");
			return 0;
		}
		SetWindowLongPtr(mh_Child, GWLP_ID, IDD_SPG_APPDISTINCT2);

		if (!mp_DpiDistinct2 && mp_ParentDpi)
		{
			mp_DpiDistinct2 = new CDpiForDialog();
			mp_DpiDistinct2->Attach(mh_Child, mh_Dlg, mp_DlgDistinct2);
		}

		HWND hHolder = GetDlgItem(mh_Dlg, tAppDistinctHolder);
		RECT rcPos = {}; GetWindowRect(hHolder, &rcPos);
		MapWindowPoints(NULL, mh_Dlg, (LPPOINT)&rcPos, 2);
		POINT ptScroll = {};
		HWND hEnd = GetDlgItem(mh_Child,stAppDistinctBottom);
		MapWindowPoints(hEnd, mh_Child, &ptScroll, 1);
		ShowWindow(hEnd, SW_HIDE);

		SCROLLINFO si = {sizeof(si), SIF_ALL};
		si.nMax = ptScroll.y - (rcPos.bottom - rcPos.top);
		RECT rcChild = {}; GetWindowRect(GetDlgItem(mh_Child, DistinctControls[1].nOverrideID), &rcChild);
		si.nPage = rcChild.bottom - rcChild.top;
		SetScrollInfo(mh_Child, SB_VERT, &si, FALSE);

		MoveWindowRect(mh_Child, rcPos);

		ShowWindow(hHolder, SW_HIDE);
		ShowWindow(mh_Child, SW_SHOW);

		//_ASSERTE(mh_Child && IsWindow(mh_Child));
	}

	return (mh_Child != NULL);
}
开发者ID:jslilly,项目名称:ConEmu,代码行数:59,代码来源:SetPgApps.cpp


示例14: dreamSock_GetPacket

//-----------------------------------------------------------------------------
// Name: empty()
// Desc: 
//-----------------------------------------------------------------------------
int dreamSock_GetPacket(SOCKET sock, char *data, struct sockaddr *from)
{
	int ret;
	struct sockaddr tempFrom;
	socklen_t fromlen;

	fromlen = sizeof(tempFrom);

	ret = recvfrom(sock, data, 1400, 0, (struct sockaddr *) &tempFrom, &fromlen);

	// Copy the address to the from pointer
	if(from != NULL)
		*(struct sockaddr *) from = tempFrom;

	if(ret == -1)
	{
#ifdef WIN32
		errno = WSAGetLastError();

		// Silently handle wouldblock
		if(errno == WSAEWOULDBLOCK)
			return ret;

		if(errno == WSAEMSGSIZE)
		{
			// ERROR: Oversize packet

			return ret;
		}

		LogString("Error code %d: recvfrom() : %s", errno, strerror(errno));
#else
		// Silently handle wouldblock
		if(errno == EWOULDBLOCK || errno == ECONNREFUSED)
			return ret;

		LogString("Error code %d: recvfrom() : %s", errno, strerror(errno));
#endif

		return ret;
	}

	return ret;
}
开发者ID:jbreslin33,项目名称:breslingame,代码行数:48,代码来源:dreamSockGlobal.cpp


示例15: LogString

//-----------------------------------------------------------------------------
// Name: empty()
// Desc: 
//-----------------------------------------------------------------------------
void CArmyWar::CheckPredictionError(int a)
{
	if(a < 0 && a > COMMAND_HISTORY_SIZE)
		return;

	float errorX =
		localClient->serverFrame.origin.x - localClient->frame[a].predictedOrigin.x;
		
	float errorY =
		localClient->serverFrame.origin.y - localClient->frame[a].predictedOrigin.y;

	// Fix the prediction error
	if( (errorX != 0.0f) || (errorY != 0.0f) )
	{
		localClient->frame[a].predictedOrigin.x = localClient->serverFrame.origin.x;
		localClient->frame[a].predictedOrigin.y = localClient->serverFrame.origin.y;

		localClient->frame[a].vel.x = localClient->serverFrame.vel.x;
		localClient->frame[a].vel.y = localClient->serverFrame.vel.y;

		LogString("Prediction error for frame %d:     %f, %f\n", a,
			errorX, errorY);
	}




	float errorXrot =
		localClient->serverFrame.rot.w - localClient->frame[a].predictedRot.w;
		
	float errorYrot =
		localClient->serverFrame.rot.y - localClient->frame[a].predictedRot.y;

	// Fix the prediction error
	if( (errorXrot != 0.0f) || (errorYrot != 0.0f) )
	{
		localClient->frame[a].predictedRot.w = localClient->serverFrame.rot.w;
		localClient->frame[a].predictedRot.y = localClient->serverFrame.rot.y;

		LogString("Prediction rot error for frame %d:     %f, %f\n", a,
			errorXrot, errorYrot);
	}

}
开发者ID:jbreslin33,项目名称:networksinbad,代码行数:48,代码来源:client.cpp


示例16: lstrcpyn

CLogFunction::~CLogFunction()
{
	if (!mb_Logged)
		return;
	--m_FnLevel;

	if (!gpLogSize || !(mc_FnInfo[0])) return;

	if (mn_FnSuffix)
	{
		const int cchSpaceLeft = static_cast<int>(std::size(mc_FnInfo) - mn_FnSuffix);
		lstrcpyn(mc_FnInfo + mn_FnSuffix, kFnEnd, cchSpaceLeft);
		LogString(mc_FnInfo);
	}
	else
	{
		LogString(CEStr(mc_FnInfo, kFnEnd));
	}
}
开发者ID:Maximus5,项目名称:ConEmu,代码行数:19,代码来源:LogFunction.cpp


示例17: LogString

void CTaskBar::Taskbar_UpdateOverlay()
{
	if (!this || !mp_TaskBar3)
	{
		LogString(L"Taskbar_UpdateOverlay skipped: !mp_TaskBar3");
		return;
	}

	// TODO: Separate option is required!
	if (!gpSet->isTaskbarShield)
	{
		Taskbar_SetOverlay(NULL);
		LogString(L"Taskbar_UpdateOverlay skipped: !isTaskbarShield");
		return;
	}

	bool bAdmin;
	HICON hIcon;

	if ((hIcon = gpConEmu->GetCurrentVConIcon()) != NULL)
	{
		LogString(L"Taskbar_UpdateOverlay executed with tab icon");
		if (!isTaskbarSmallIcons())
		{
			Taskbar_SetOverlay(hIcon);
			DestroyIcon(hIcon);
		}
		else
		{
			gpConEmu->SetTaskbarIcon(hIcon);
		}
	}
	else if (!IsWindows7)
	{
		LogString(L"Taskbar_UpdateOverlay skipped: !IsWindows7");
	}
	else
	{
		LogString(L"Taskbar_UpdateOverlay executed with [non]admin icon");
		bAdmin = gpConEmu->IsActiveConAdmin();
		Taskbar_SetShield(bAdmin);
	}
}
开发者ID:BigVal71,项目名称:ConEmu,代码行数:43,代码来源:TaskBar.cpp


示例18: dreamSock_SetBroadcasting

//-----------------------------------------------------------------------------
// Name: empty()
// Desc: 
//-----------------------------------------------------------------------------
int dreamSock_SetBroadcasting(SOCKET sock, int mode)
{
	// make it broadcast capable
	if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char *) &mode, sizeof(int)) == -1)
	{
		LogString("DreamSock_SetBroadcasting failed");

#ifdef WIN32
		int err = WSAGetLastError();
		LogString("Error code %d: setsockopt() : %s", err, strerror(err));
#else
		LogString("Error code %d: setsockopt() : %s", errno, strerror(errno));
#endif

		return DREAMSOCK_INVALID_SOCKET;
	}

	return 0;
}
开发者ID:jbreslin33,项目名称:breslingame,代码行数:23,代码来源:dreamSockGlobal.cpp


示例19: va_start

void CLog::Log(int loglevel, const char *format, ...)
{
  if (IsLogLevelLogged(loglevel))
  {
    va_list va;
    va_start(va, format);
    LogString(loglevel, StringUtils::FormatV(format, va));
    va_end(va);
  }
}
开发者ID:Elzevir,项目名称:xbmc,代码行数:10,代码来源:log.cpp


示例20: GetConnectionFromHandle

///////////////////////////////////////////////////////////////
//
// CDatabaseJobQueueImpl::LogResult
//
// Log last job if connection has logging enabled
//
///////////////////////////////////////////////////////////////
void CDatabaseJobQueueImpl::LogResult ( CDbJobData* pJobData )
{
    // Early out if logging switched off globally
    if ( m_LogLevel == EJobLogLevel::NONE )
        return;

    // Check logging status of connection
    CDatabaseConnection* pConnection = GetConnectionFromHandle ( pJobData->command.connectionHandle );
    if ( !pConnection || !pConnection->m_bLoggingEnabled )
        return;

    if ( pJobData->result.status == EJobResult::SUCCESS )
    {
        if ( m_LogLevel >= EJobLogLevel::ALL )
        {
            SString strLine ( "%s: [%s] SUCCESS: Affected rows:%d [Query:%s]\n"
                                    , *GetLocalTimeString ( true, true )
                                    , *pConnection->m_strLogTag
                                    , pJobData->result.registryResult->uiNumAffectedRows
                                    , *pJobData->GetCommandStringForLog()
                                );
            LogString ( strLine );
        }
    }
    else
    {
        if ( m_LogLevel >= EJobLogLevel::ERRORS )
        {
            // Suppress requested errors unless logging is set to ALL
            if ( pJobData->result.bErrorSuppressed && m_LogLevel != EJobLogLevel::ALL )
                return;

            SString strLine ( "%s: [%s] FAIL: (%d) %s [Query:%s]\n"
                                    , *GetLocalTimeString ( true, true )
                                    , *pConnection->m_strLogTag
                                    , pJobData->result.uiErrorCode
                                    , *pJobData->result.strReason
                                    , *pJobData->GetCommandStringForLog()
                                );
            LogString ( strLine );
        }
    }
}
开发者ID:tousuke,项目名称:mtasa-blue,代码行数:50,代码来源:CDatabaseJobQueue.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LogText函数代码示例发布时间:2022-05-30
下一篇:
C++ LogRelFlow函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap