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 ...@@ -946,6 +946,25 @@ namespace NSFile
return FALSE; 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 class CBase64Converter
......
This diff is collapsed.
...@@ -53,6 +53,8 @@ public: ...@@ -53,6 +53,8 @@ public:
std::map<std::wstring, bool> m_mapImagesInChanges; std::map<std::wstring, bool> m_mapImagesInChanges;
std::wstring m_sConsoleLogFile;
public: public:
CMemoryStream* m_pStream; CMemoryStream* m_pStream;
...@@ -67,6 +69,8 @@ public: ...@@ -67,6 +69,8 @@ public:
m_pSaveBinary = NULL; m_pSaveBinary = NULL;
m_nSaveLen = 0; m_nSaveLen = 0;
m_nSaveBinaryLen = 0; m_nSaveBinaryLen = 0;
m_sConsoleLogFile = L"";
} }
~CNativeControl() ~CNativeControl()
{ {
...@@ -142,12 +146,13 @@ public: ...@@ -142,12 +146,13 @@ public:
void ConsoleLog(/*UTF8*/const std::string& strVal) void ConsoleLog(/*UTF8*/const std::string& strVal)
{ {
#if 1 if (!m_sConsoleLogFile.empty())
FILE* f = fopen("C:/log.txt", "a+"); {
FILE* f = NSFile::CFileBinary::OpenFileNative(m_sConsoleLogFile, L"a+");
fprintf(f, strVal.c_str()); fprintf(f, strVal.c_str());
fprintf(f, "\n"); fprintf(f, "\n");
fclose(f); fclose(f);
#endif }
} }
void CheckFonts() 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