Index: src/libchcore/TSubTaskScanDirectory.cpp =================================================================== diff -u -N -rd18db617f4727a237c94b59af9b4328f829eda16 -r6f8b891b60eb0f33199fd29db75d4d9f4a22c248 --- src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision d18db617f4727a237c94b59af9b4328f829eda16) +++ src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 6f8b891b60eb0f33199fd29db75d4d9f4a22c248) @@ -39,15 +39,15 @@ #include "TBufferSizes.h" #include "TFileException.h" #include "TFilesystemFeedbackWrapper.h" -#include "log.h" namespace chcore { /////////////////////////////////////////////////////////////////////////////////////////////////// // class TSubTaskScanDirectories TSubTaskScanDirectories::TSubTaskScanDirectories(TSubTaskContext& rContext) : TSubTaskBase(rContext), - m_tSubTaskStats(eSubOperation_Scanning) + m_tSubTaskStats(eSubOperation_Scanning), + m_log(rContext.GetLogPath().ToString(), L"ST-ScanDirs") { } @@ -85,17 +85,16 @@ TFeedbackHandlerWrapperPtr spFeedbackHandler(std::make_shared(spFeedback, guard)); // log - log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TBasePathDataContainerPtr spBasePaths = GetContext().GetBasePaths(); const TConfig& rConfig = GetContext().GetConfig(); const TFileFiltersArray& rafFilters = GetContext().GetFilters(); IFilesystemPtr spFilesystem = GetContext().GetLocalFilesystem(); - TFilesystemFeedbackWrapper tFilesystemFBWrapper(spFeedbackHandler, spFilesystem, rLog, rThreadController); + TFilesystemFeedbackWrapper tFilesystemFBWrapper(spFeedbackHandler, spFilesystem, GetContext().GetLogPath(), rThreadController); - rLog.logi(_T("Searching for files...")); + LOG_INFO(m_log) << _T("Searching for files..."); // reset progress rFilesCache.SetComplete(false); @@ -148,7 +147,7 @@ // log strFormat = _T("Adding file/folder (clipboard) : %path ..."); strFormat.Replace(_T("%path"), pathCurrent.ToString()); - rLog.logi(strFormat.c_str()); + LOG_INFO(m_log) << strFormat.c_str(); // add if needed if (spFileInfo->IsDirectory()) @@ -162,22 +161,22 @@ // log strFormat = _T("Added folder %path"); strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat.c_str()); + LOG_INFO(m_log) << strFormat.c_str(); } // don't add folder contents when moving inside one disk boundary // log strFormat = _T("Recursing folder %path"); strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat.c_str()); + LOG_INFO(m_log) << strFormat.c_str(); ScanDirectory(spFileInfo->GetFullFilePath(), spBasePath, true, !bIgnoreDirs || bForceDirectories, rafFilters); // check for kill need if (rThreadController.KillRequested()) { // log - rLog.logi(_T("Kill request while adding data to files array (RecurseDirectories)")); + LOG_INFO(m_log) << _T("Kill request while adding data to files array (RecurseDirectories)"); rFilesCache.Clear(); return eSubResult_KillRequest; } @@ -191,7 +190,7 @@ // log strFormat = _T("Added file %path"); strFormat.Replace(_T("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat.c_str()); + LOG_INFO(m_log) << strFormat.c_str(); } } @@ -203,7 +202,7 @@ rFilesCache.SetComplete(true); // log - rLog.logi(_T("Searching for files finished")); + LOG_INFO(m_log) << _T("Searching for files finished"); return eSubResult_Continue; }