Index: src/libchcore/TFilesystemFileFeedbackWrapper.cpp =================================================================== diff -u -N -rd18db617f4727a237c94b59af9b4328f829eda16 -r6f8b891b60eb0f33199fd29db75d4d9f4a22c248 --- src/libchcore/TFilesystemFileFeedbackWrapper.cpp (.../TFilesystemFileFeedbackWrapper.cpp) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/libchcore/TFilesystemFileFeedbackWrapper.cpp (.../TFilesystemFileFeedbackWrapper.cpp) (revision 6f8b891b60eb0f33199fd29db75d4d9f4a22c248) @@ -23,13 +23,12 @@ #include #include "TFileInfo.h" #include "TWorkerThreadController.h" -#include "log.h" namespace chcore { - TFilesystemFileFeedbackWrapper::TFilesystemFileFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, log_file& rLog, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem) : + TFilesystemFileFeedbackWrapper::TFilesystemFileFeedbackWrapper(const IFeedbackHandlerPtr& spFeedbackHandler, const TSmartPath& pathLogger, TWorkerThreadController& rThreadController, const IFilesystemPtr& spFilesystem) : m_spFeedbackHandler(spFeedbackHandler), - m_rLog(rLog), + m_log(pathLogger.ToString(), L"Filesystem-File"), m_rThreadController(rThreadController), m_spFilesystem(spFilesystem) { @@ -71,7 +70,7 @@ TString strFormat = _T("Cancel request [error %errno] while opening source file %path (OpenSourceFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), fileSrc->GetFilePath().ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); return TSubTaskBase::eSubResult_CancelRequest; } @@ -85,7 +84,7 @@ TString strFormat = _T("Retrying [error %errno] to open source file %path (OpenSourceFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), fileSrc->GetFilePath().ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); bRetry = true; break; @@ -158,7 +157,7 @@ TString strFormat = _T("Retrying [error %errno] to open destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), fileDst->GetFilePath().ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); bRetry = true; break; @@ -169,7 +168,7 @@ TString strFormat = _T("Cancel request [error %errno] while opening destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), fileDst->GetFilePath().ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); return TSubTaskBase::eSubResult_CancelRequest; } @@ -261,7 +260,7 @@ // log TString strFormat = _T("Cancel request while checking result of dialog before opening source file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%path"), fileDst->GetFilePath().ToString()); - m_rLog.logi(strFormat.c_str()); + LOG_INFO(m_log) << strFormat.c_str(); return TSubTaskBase::eSubResult_CancelRequest; } @@ -283,7 +282,7 @@ TString strFormat = _T("Retrying [error %errno] to open destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), fileDst->GetFilePath().ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); bRetry = true; @@ -295,7 +294,7 @@ TString strFormat = _T("Cancel request [error %errno] while opening destination file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), fileDst->GetFilePath().ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); return TSubTaskBase::eSubResult_CancelRequest; } @@ -342,7 +341,7 @@ TString strFormat = _T("Error %errno while truncating file %path to 0"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), pathFile.ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eResizeError, dwLastError); switch (frResult.GetResult()) @@ -398,7 +397,7 @@ strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%count"), boost::lexical_cast(rBuffer.GetRequestedDataSize()).c_str()); strFormat.Replace(_T("%path"), pathFile.ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eReadError, dwLastError); switch (frResult.GetResult()) @@ -455,7 +454,7 @@ strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%count"), boost::lexical_cast(rBuffer.GetBytesTransferred()).c_str()); strFormat.Replace(_T("%path"), pathFile.ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eWriteError, dwLastError); switch (frResult.GetResult()) @@ -511,7 +510,7 @@ TString strFormat = _T("Error %errno while trying to finalize file %path (CustomCopyFileFB)"); strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); strFormat.Replace(_T("%path"), pathFile.ToString()); - m_rLog.loge(strFormat.c_str()); + LOG_ERROR(m_log) << strFormat.c_str(); TFeedbackResult frResult = m_spFeedbackHandler->FileError(pathFile.ToWString(), TString(), EFileError::eFinalizeError, dwLastError); switch (frResult.GetResult())