Пример #1
0
void Init_Logging(IHXTLogWriter** ppILog)
{
    HXScopeLock lock(g_pCreationMutex);

    g_bTriedInit = TRUE;

    if (!g_pLogSystem)
    {
        UINT32 ulNameLen = 255;
        CHXString strDllName;
        DLLAccess::CreateName("log", "log", strDllName.GetBuffer(ulNameLen+1), ulNameLen, 0, 0);
        strDllName.ReleaseBuffer();

        FPCREATELOGSYSTEMINTERFACE fpCreateLogSystem = NULL;
        if (g_LogDLL.isOpen() || g_LogDLL.open(strDllName, DLLTYPE_ENCSDK) == DLLAccess::DLL_OK)
        {
            fpCreateLogSystem = (FPCREATELOGSYSTEMINTERFACE)(g_LogDLL.getSymbol("RMACreateLogSystem"));
        }

        // Note: Application is reponsible should display warning msg that logging
        // failed to load.  SDK plugins should not printf anything
        DoLogSystemInterfaceInit(fpCreateLogSystem, NULL);
        if (g_pLogWriter)
        {
            g_pLogWriter->QueryInterface(IID_IHXTLogWriter, (void**)ppILog);
        }
    }
}