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


C++ Log::Debug方法代码示例

本文整理汇总了C++中Log::Debug方法的典型用法代码示例。如果您正苦于以下问题:C++ Log::Debug方法的具体用法?C++ Log::Debug怎么用?C++ Log::Debug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Log的用法示例。


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

示例1: ExtractFileFromResource

static void ExtractFileFromResource(HMODULE hImage, DWORD resId, LPCTSTR path)
{
    g_Log.Debug(_T("Extracting resource %d to \"%s\"..."), resId, path);
    HRSRC hDbghelpRes = FindResource(hImage, MAKEINTRESOURCE(resId), RT_RCDATA);
    if (!hDbghelpRes)
        throw runtime_error("failed to find file in resources");

    HGLOBAL hDbghelpGlobal = LoadResource(hImage, hDbghelpRes);
    if (!hDbghelpGlobal)
        throw runtime_error("failed to load file from resources");

    CAtlFile hFile(CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL));
    if (hFile == INVALID_HANDLE_VALUE)
        throw runtime_error("failed to create file");

    if (FAILED(hFile.Write(LockResource(hDbghelpGlobal), SizeofResource(hImage, hDbghelpRes))))
        throw runtime_error("failed to write file");
}
开发者ID:kusl,项目名称:TortoiseSVN,代码行数:18,代码来源:DumpWriter.cpp

示例2: if

std::unique_ptr<Response> Response::CreateResponse(const ns1__Response& response, Log& log)
{
    std::unique_ptr<Response> result;
    if (SOAP_TYPE_ns1__HaveSolutionResponse == response.soap_type())
    {
        log.Debug(_T("\thas solution"));
        const ns1__HaveSolutionResponse& resp = static_cast<const ns1__HaveSolutionResponse&>(response);
        std::unique_ptr<HaveSolutionResponse> res(new HaveSolutionResponse);
        res->askConfirmation = resp.askConfirmation;
        res->type = resp.type;
        log.Debug(_T("\t\ttype\t%d"), res->type);
        if (resp.url)
        {
            res->url = resp.url->c_str();
            log.Debug(_T("\t\tURL\t%ls"), res->url.c_str());
        }
        if (resp.exe)
        {
            res->exe.assign(resp.exe->__ptr, resp.exe->__ptr + resp.exe->__size);
            log.Debug(_T("\t\thas EXE, size\t%d"), res->exe.size());
        }
        result = std::move(res);
    }
    else if (SOAP_TYPE_ns1__NeedSymbolsThenMiniDumpResponse == response.soap_type() || SOAP_TYPE_ns1__NeedMiniDumpResponse == response.soap_type())
    {
        result.reset(new NeedMiniDumpResponse);
    }
    else if (SOAP_TYPE_ns1__NeedFullDumpResponse == response.soap_type())
    {
        const ns1__NeedFullDumpResponse& resp = static_cast<const ns1__NeedFullDumpResponse&>(response);
        std::unique_ptr<NeedFullDumpResponse> res(new NeedFullDumpResponse);

        res->restrictedDumpType = resp.restrictedDumpType;
        res->attachUserInfo = resp.attachUserInfo;

        result = std::move(res);
    }
    else if (SOAP_TYPE_ns1__NeedMoreInfoResponse == response.soap_type())
    {
        const ns1__NeedMoreInfoResponse& resp = static_cast<const ns1__NeedMoreInfoResponse&>(response);
        std::unique_ptr<NeedMoreInfoResponse> res(new NeedMoreInfoResponse);
        if (resp.infoModule && resp.infoModule->__size > 0)
            res->infoModule.assign(resp.infoModule->__ptr, resp.infoModule->__ptr + resp.infoModule->__size);
        else
            res->infoModule.clear();
        if (resp.infoModuleCfg)
            res->infoModuleCfg = resp.infoModuleCfg->c_str();
        else
            res->infoModuleCfg = L"";
        result = std::move(res);
    }
    else if (SOAP_TYPE_ns1__StopResponse == response.soap_type())
    {
        result.reset(new StopResponse);
    }
    else if (SOAP_TYPE_ns1__ErrorResponse == response.soap_type())
    {
        const ns1__ErrorResponse& resp = static_cast<const ns1__ErrorResponse&>(response);
        std::unique_ptr<ErrorResponse> res(new ErrorResponse);
        res->error = *resp.error;
        log.Debug(_T("\terror\t\"%ls\""), res->error.c_str());
        result = std::move(res);
    }
    else
    {
        throw std::runtime_error("unknown response type");
    }

    if (response.clientID)
    {
        result->clientID = *response.clientID;
        log.Debug(_T("\tCliendID = \"%ls\""), result->clientID.c_str());
    }
    result->problemID = response.problemID ? *response.problemID : 0;
    result->dumpGroupID = response.dumpGroupID ? *response.dumpGroupID : 0;
    result->dumpID = response.dumpID ? *response.dumpID : 0;
    log.Debug(_T("\tproblemID = %d, dumpGroupID = %d, dumpID = %d"), result->problemID, result->dumpGroupID, result->dumpID);
    if (response.urlToProblem)
    {
        result->urlToProblem = *response.urlToProblem;
        log.Debug(_T("\tURL to problem = \"%ls\""), result->urlToProblem.c_str());
    }
    else
    {
        result->urlToProblem = L"";
    }
    if (response.context && response.context->__size > 0)
        result->context.assign(response.context->__ptr, response.context->__ptr + response.context->__size);
    else
        result->context.clear();

    return result;
}
开发者ID:15375514460,项目名称:TortoiseGit,代码行数:93,代码来源:DoctorDump.cpp


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