本文整理汇总了C++中LogTrace函数的典型用法代码示例。如果您正苦于以下问题:C++ LogTrace函数的具体用法?C++ LogTrace怎么用?C++ LogTrace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LogTrace函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMessageReplyError
void CEsperEngine::MsgEsperRead (const SArchonMessage &Msg)
// MsgEsperRead
//
// Requests a read on the given connection. If we fail, we return an error
// to the caller.
{
CDatum dConnection = Msg.dPayload.GetElement(0);
CString sError;
if (!m_Connections.BeginRead(Msg, dConnection, &sError))
{
SendMessageReplyError(MSG_ERROR_UNABLE_TO_COMPLY, strPattern(ERR_READ_FAILED, sError), Msg);
if (m_bLogTrace)
LogTrace(strPattern("[%x] Read failed: %s", CEsperInterface::ConnectionToFriendlyID(dConnection), sError));
return;
}
#ifdef DEBUG_SOCKET_OPS
if (m_bLogTrace)
LogTrace(strPattern("[%x] Read", CEsperInterface::ConnectionToFriendlyID(dConnection)));
#endif
// We reply when the async operation completes (or we get an error).
}
示例2: LogTrace
bool TCPServer::Listen(int port)
{
LogTrace(LOG_NETWORKING, "Listening for incoming connections {port: %d}", port);
struct sockaddr_in bind_address;
uv_ip4_addr("0.0.0.0", port, &bind_address);
int result = uv_tcp_init(uv_default_loop(), &_listener);
if (result)
{
LogError(LOG_NETWORKING, "Listening for incoming connections - failure, reason: %s", uv_err_name(result));
return false;
}
result = uv_tcp_bind(&_listener, (const struct sockaddr *) &bind_address, 0);
if (result)
{
LogError(LOG_NETWORKING, "Listening for incoming connections - failure, reason: %s", uv_err_name(result));
return false;
}
result = uv_listen((uv_stream_t *) &_listener, SOMAXCONN, IncomingConnection);
if (result)
{
LogError(LOG_NETWORKING, "Listening for incoming connections - failure, reason: %s", uv_err_name(result));
return false;
}
LogTrace(LOG_NETWORKING, "Listening for incoming connections - success", port);
return true;
}
示例3: operator
void ExecutorDummy::printSyncs()
{
typedef pair<string, uint64_t> Record;
struct comp
{
bool operator()(Record const &a, Record const &b) const
{
return a.second > b.second;
}
};
vector<Record> sorted;
sorted.reserve(syncs_.size());
for (auto &r : syncs_)
{
string str = methods_->getMethod(r.first).second;
sorted.emplace_back(str, r.second);
}
std::sort(sorted.begin(), sorted.end(), comp());
size_t num = std::min<size_t>(10, sorted.size());
LogTrace("sync stats: " << numFrames_ << " frames");
for (size_t i = 0; i < num; ++i)
LogTrace(sorted[i].first << ": " << sorted[i].second);
syncs_.clear();
numFrames_ = 0;
}
示例4: __UpdateBackendPath
static FORCEINLINE NTSTATUS
__UpdateBackendPath(
IN PXENVBD_FRONTEND Frontend
)
{
NTSTATUS Status;
PCHAR Path;
if (Frontend->BackendPath) {
LogTrace("<< %s\n", Frontend->BackendPath);
AustereFree(Frontend->BackendPath);
Frontend->BackendPath = NULL;
}
Status = StoreRead(NULL, Frontend->FrontendPath,
"backend-id", &Path);
if (NT_SUCCESS(Status)) {
Frontend->BackendId = (USHORT)strtoul(Path, NULL, 10);
AustereFree(Path);
} else {
Frontend->BackendId = 0;
}
Status = StoreRead(NULL, Frontend->FrontendPath,
"backend", &Path);
if (NT_SUCCESS(Status)) {
LogTrace(">> %s\n", Path);
Frontend->BackendPath = Path;
}
return Status;
}
示例5: UnhookCreateDXGIFactory2Function
/// Helper function to unhook the CreateFactory2 interface
/// \param hDXGI Input DXGI module
void UnhookCreateDXGIFactory2Function(HMODULE hDXGI)
{
LogTrace(traceENTER, "");
// don't detach twice
if (Real_CreateDXGIFactory2 == NULL)
{
Log(logERROR, "Attempting to call UnhookCreateDXGIFactory2() twice\n");
LogTrace(traceEXIT, "");
return;
}
if (hDXGI != NULL)
{
LONG error;
AMDT::BeginHook();
LogTrace(traceEXIT, "UnhookCreateDXGIFactory2");
UNHOOK(Real_CreateDXGIFactory2, Mine_CreateDXGIFactory2);
if (AMDT::EndHook() != NO_ERROR)
{
Log(logERROR, "UnhookCreateDXGIFactory2 Failed\n");
}
}
Real_CreateDXGIFactory2 = NULL;
LogTrace(traceEXIT, "");
return;
}
示例6: LogTrace
void SysConsoleServiceImp::updateLocalGid(std::string& _return, const int32_t localGid, const int32_t groupId, const int64_t timestamp, const std::string& oldIp, const std::string& newIp)
{
LogTrace(Info, "localGid = %d, groupId = %d, oldipStr = %s, newIP = %s", localGid, groupId, oldIp.c_str(), newIp.c_str());
if(!(localGid>=2048 && localGid<=4097))
{
_return = "invalid localGid";
return;
}
IMetaDao *metaDao_mp = sysc->mDao;
Meta m;
m.serverId= localGid;
m.timestamp = sysc->nv->getVersion();
m.name = LOCALGIDMETANAME;
m.groupId = groupId;
m.type = METASERVER_TYPE;
m.data = newIp;
m.isDel = 0;
if(metaDao_mp->updateLocalGid(m,oldIp,timestamp) == -1)
{
LogTrace(Error,"config localGid error, err= %d", myerrno);
char buf[100];
sprintf(buf, "setMeta db error:%d", myerrno);
_return = buf;
}else{
_return = "config ok";
}
}
示例7: onFailure
JobStatus FullSnapJob::onSyncLsn(bool bto, int res)
{
if(bto || res != 0){
return onFailure(bto, res);
}else{
std::vector<Lsn> tmpLsns;
for(std::vector<DLog>::const_iterator it = logs.begin(); it != logs.end(); ++it){
Lsn tmp;
tmp.node = it->node;
tmp.lsn = it->lsn;
tmpLsns.push_back(tmp);
LogTrace(Info, "node = %d, lsn = %lld",tmp.node, tmp.lsn);
}
logs.clear();
cli->lastLsn.swap(tmpLsns); // update session sync's lastlsns
if(cli->lastLsn.empty())
{
LogTrace(Error,"last lsn is empty");
complete = true;
cli->snapGameover = true;
return JOBSTOP;
}
lsnVecIndex = 0;
lastLsnId = 0;
step = SyncDLog_C;
ASYNC_CALL(SnapService, getDLogs, &FullSnapJob::onSyncLog, logs, sessionId,cli->lastLsn[lsnVecIndex].node,lastLsnId,1000);
return SYSDEFAULT;
}
}
示例8: LogTrace
/// 終了処理
/// 全てのメモリ開放
void Graphics::term(void)
{
LogTrace("start\n");
mGeom.term();
mWnd.term();
LogTrace("end \n");
}
示例9: LogTrace
DWORD WINAPI CardDeleteContext
(
__inout PCARD_DATA pCardData
)
{
DWORD dwReturn = 0;
LogTrace(LOGTYPE_INFO, WHERE, "Enter API...");
/********************/
/* Check Parameters */
/********************/
if ( pCardData == NULL )
{
LogTrace(LOGTYPE_ERROR, WHERE, "Invalid parameter [pCardData]");
CLEANUP(SCARD_E_INVALID_PARAMETER);
}
LogTrace(LOGTYPE_INFO, WHERE, "Context:[0x%08X]", pCardData->hSCardCtx);
if (pCardData->pvVendorSpecific != NULL)
{
pCardData->pfnCspFree(pCardData->pvVendorSpecific);
pCardData->pvVendorSpecific = NULL;
}
cleanup:
LogTrace(LOGTYPE_INFO, WHERE, "Exit API...");
return (dwReturn);
}
示例10: Stealth_CheckSuccess
int32 Stealth_CheckSuccess(AActor* oStealther, AActor* oPerceiver)
{
//TODO implement Stealth_CheckSuccess fully
LogTrace(LOG_CHANNEL_COMBAT_ABILITY, "Perception check for " + GetTag(oPerceiver) + " detecting " + GetTag(oStealther));
int32 bCombatState = GetCombatState(oStealther);
int32 nStealthRank = Stealth_GetStealthRank(oStealther);
int32 nPerceptionRank = Stealth_GetPerceptionRank(oPerceiver);
if ((bCombatState == FALSE_) || (nStealthRank >= nPerceptionRank))
{
return TRUE_;
}
else
{
#ifdef DEBUG
LogTrace(LOG_CHANNEL_COMBAT_ABILITY, "DETECTED by " + GetTag(oPerceiver));
#endif
// display stealth detected UI message
UI_DisplayMessage(oStealther, 3511);
UI_DisplayMessage(oPerceiver, 3513);
return FALSE_;
}
}
示例11: FrontendDestroy
VOID
FrontendDestroy(
IN PXENVBD_FRONTEND Frontend
)
{
const ULONG TargetId = Frontend->TargetId;
LogTrace("Target[%d] @ (%d) =====>\n", TargetId, KeGetCurrentIrql());
ASSERT3U(Frontend->RingGrantRef, ==, 0);
ASSERT3P(Frontend->EvtchnPort, ==, 0);
// free memory
if (Frontend->FrontendPath) {
AustereFree(Frontend->FrontendPath);
Frontend->FrontendPath = NULL;
}
if (Frontend->TargetPath) {
AustereFree(Frontend->TargetPath);
Frontend->TargetPath = NULL;
}
if (Frontend->BackendPath) {
AustereFree(Frontend->BackendPath);
Frontend->BackendPath = NULL;
}
LogTrace("Target[%d] @ (%d) <=====\n", TargetId, KeGetCurrentIrql());
}
示例12: HookCreateDXGIFactory2Function
/// Helper function to hook the CreateFactory2 interface
/// \param hDXGI Input DXGI module
void HookCreateDXGIFactory2Function(HMODULE hDXGI)
{
LogTrace(traceENTER, "");
// don't attach twice
if (Real_CreateDXGIFactory2 != NULL)
{
LogTrace(traceEXIT, "already hooked");
return;
}
Real_CreateDXGIFactory2 = (CreateDXGIFactory2_type)GetProcAddress(hDXGI, "CreateDXGIFactory2");
if (Real_CreateDXGIFactory2 != NULL)
{
LONG error;
AMDT::BeginHook();
HOOK(Real_CreateDXGIFactory2, Mine_CreateDXGIFactory2);
if (AMDT::EndHook() != NO_ERROR)
{
Log(logERROR, "HookCreateDXGIFactory2 Failed\n");
}
}
else
{
Log(logERROR, "HookCreateDXGIFactory2 Failed: Cannot find the CreateDXGIFactory2 in the current DXGI module. This is not a real error if you are using Windows7.\n");
}
LogTrace(traceEXIT, "");
return;
}
示例13: Mine_LoadLibraryExW
/// Mine entry point for intercepted function
/// \param lpLibFileName Library file name
/// \param hFile File handle
/// \param dwFlags load flags
/// \return Loaded module.
static HMODULE WINAPI Mine_LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
{
RefTracker rf(&s_dwInsideLoadLibrary);
if (s_dwInsideLoadLibrary == 1)
{
LogTrace(traceENTER, "lpLibFilename = %S, hFile = %p, dwFlags = %d", lpLibFileName, hFile, dwFlags);
}
HMODULE res = Real_LoadLibraryExW(lpLibFileName, hFile, dwFlags);
DWORD realError = GetLastError();
if (my_lstrcmpW(lpLibFileName, L"comctl32.dll") != 0)
{
// This function uses MessageBox - which will load comctl32.dll if necessary
// To avoid recursion problems, only call it when a different DLL is being loaded.
CheckForDebuggerAttach();
}
if (s_dwInsideLoadLibrary == 1)
{
CheckWrappers();
LogTrace(traceEXIT, "returned 0x%p", res);
}
SetLastError(realError);
return res;
}
示例14: HookLoadLibrary
/// Hook the load library functions
void HookLoadLibrary()
{
LogTrace(traceENTER, "");
AMDT::BeginHook();
LONG error = AMDT::HookAPICall(&(PVOID&)Real_LoadLibraryA, Mine_LoadLibraryA);
PsAssert(error == NO_ERROR);
error = AMDT::HookAPICall(&(PVOID&)Real_LoadLibraryExA, Mine_LoadLibraryExA);
PsAssert(error == NO_ERROR);
error = AMDT::HookAPICall(&(PVOID&)Real_LoadLibraryW, Mine_LoadLibraryW);
PsAssert(error == NO_ERROR);
error = AMDT::HookAPICall(&(PVOID&)Real_LoadLibraryExW, Mine_LoadLibraryExW);
PsAssert(error == NO_ERROR);
error = AMDT::HookAPICall(&(PVOID&)Real_FreeLibrary, Mine_FreeLibrary);
PsAssert(error == NO_ERROR);
if (AMDT::EndHook() != NO_ERROR)
{
Log(logERROR, "HookLoadLibrary() failed\n");
}
// Load the "dxgi.dll" at the beginning as we missed the dxgi loading sometimes.
// TODO: Fix this: This function is called from DllMain(), and according to the
// Microsoft documentation, LoadLibrary() should not be called from DllMain()
LoadLibraryA("dxgi.dll");
LogTrace(traceEXIT, "");
return;
}
示例15: DllInitialize
NTSTATUS
DllInitialize(
IN PUNICODE_STRING RegistryPath
)
{
PWSTR Name;
NTSTATUS Status;
LogTrace("===>\n");
Name = wcsrchr(RegistryPath->Buffer, L'\\');
if (Name) {
Name++;
if (__StrStarts(Name, L"dump_")) {
__OperatingMode = DUMP_MODE;
} else if (__StrStarts(Name, L"hiber_")) {
__OperatingMode = HIBER_MODE;
} else {
__OperatingMode = NORMAL_MODE;
}
}
Status = STATUS_SUCCESS;
LogTrace("<=== (%08x)\n", Status);
return Status;
}