Commit a67a5198 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

включение логов в конфиге

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@64270 954022d7-b5bf-4e40-9824-e11837661b57
parent 1ccf28be
......@@ -946,6 +946,25 @@ namespace NSFile
return FALSE;
}
static FILE* OpenFileNative(const std::wstring& sFileName, const std::wstring& sMode)
{
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(_WIN64)
return _wfopen(sFileName.c_str(), sMode.c_str());
#else
BYTE* pUtf8 = NULL;
LONG lLen = 0;
CUtf8Converter::GetUtf8StringFromUnicode(sFileName.c_str(), sFileName.length(), pUtf8, lLen, false);
BYTE* pMode = NULL;
LONG lLenMode;
CUtf8Converter::GetUtf8StringFromUnicode(sMode.c_str(), sMode.length(), pMode, lLenMode, false)
m_pFile = fopen((char*)pUtf8, (char*)pMode);
delete [] pUtf8;
delete [] pMode;
#endif
}
};
class CBase64Converter
......
This diff is collapsed.
......@@ -53,6 +53,8 @@ public:
std::map<std::wstring, bool> m_mapImagesInChanges;
std::wstring m_sConsoleLogFile;
public:
CMemoryStream* m_pStream;
......@@ -67,6 +69,8 @@ public:
m_pSaveBinary = NULL;
m_nSaveLen = 0;
m_nSaveBinaryLen = 0;
m_sConsoleLogFile = L"";
}
~CNativeControl()
{
......@@ -142,12 +146,13 @@ public:
void ConsoleLog(/*UTF8*/const std::string& strVal)
{
#if 1
FILE* f = fopen("C:/log.txt", "a+");
fprintf(f, strVal.c_str());
fprintf(f, "\n");
fclose(f);
#endif
if (!m_sConsoleLogFile.empty())
{
FILE* f = NSFile::CFileBinary::OpenFileNative(m_sConsoleLogFile, L"a+");
fprintf(f, strVal.c_str());
fprintf(f, "\n");
fclose(f);
}
}
void CheckFonts()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment