| Line 141... |
Line 141... |
| 141 |
///////////////////
|
141 |
///////////////////
|
| 142 |
|
142 |
|
| 143 |
void CFileLog::_writeLog(int iType, const Utils::WString &sLogText) const
|
143 |
void CFileLog::_writeLog(int iType, const Utils::WString &sLogText) const
|
| 144 |
{
|
144 |
{
|
| 145 |
std::wofstream outFile;
|
145 |
std::wofstream outFile;
|
| 146 |
outFile.open(_sFilename, std::ios::out | std::ios::app);
|
146 |
outFile.open(_sFilename.toStdWString(), std::ios::out | std::ios::app);
|
| 147 |
if ( outFile.is_open() ) {
|
147 |
if ( outFile.is_open() ) {
|
| 148 |
outFile << _timeStamp() << " (" << _typeName(iType) << ") " << sLogText << std::endl;
|
148 |
outFile << _timeStamp().toStdWString() << " (" << _typeName(iType).toStdWString() << ") " << sLogText.toStdWString() << std::endl;
|
| 149 |
outFile.close();
|
149 |
outFile.close();
|
| 150 |
}
|
150 |
}
|
| 151 |
}
|
151 |
}
|
| 152 |
|
152 |
|
| 153 |
Utils::WString CFileLog::_timeStamp() const
|
153 |
Utils::WString CFileLog::_timeStamp() const
|
| 154 |
{
|
154 |
{
|
| 155 |
std::wstringstream strm;
|
155 |
std::wstringstream strm;
|
| 156 |
time_t T = time(NULL);
|
156 |
time_t T = time(NULL);
|
| 157 |
struct tm *TM = localtime(&T);
|
157 |
struct tm *TM = localtime(&T);
|
| 158 |
strm << L"[" << Utils::WString::PadNumber(TM->tm_mday, 2) << L"/" << Utils::WString::PadNumber(TM->tm_mon+1, 2) << L"/" << TM->tm_year+1900 << " - " << Utils::WString::PadNumber(TM->tm_hour, 2) << L":" << Utils::WString::PadNumber(TM->tm_min, 2) << L":" << Utils::WString::PadNumber(TM->tm_sec, 2) << L"]";
|
158 |
strm << L"[" << Utils::WString::PadNumber(TM->tm_mday, 2).toStdWString() << L"/" << Utils::WString::PadNumber(TM->tm_mon+1, 2).toStdWString() << L"/" << TM->tm_year+1900 << " - " << Utils::WString::PadNumber(TM->tm_hour, 2).toStdWString() << L":" << Utils::WString::PadNumber(TM->tm_min, 2).toStdWString() << L":" << Utils::WString::PadNumber(TM->tm_sec, 2).toStdWString() << L"]";
|
| 159 |
return strm.str();
|
159 |
return strm.str();
|
| 160 |
}
|
160 |
}
|
| 161 |
|
161 |
|
| 162 |
Utils::WString CFileLog::_typeName(int iType) const
|
162 |
Utils::WString CFileLog::_typeName(int iType) const
|
| 163 |
{
|
163 |
{
|