mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
Log: Clear mwb module interface old version log and clear dotnet old version log (#39652)
* Initial plan for issue * Add cleanup of old version log folders for Mouse Without Borders Co-authored-by: vanzue <69313318+vanzue@users.noreply.github.com> * Add try-catch block to cleanup_old_logs function Co-authored-by: vanzue <69313318+vanzue@users.noreply.github.com> * Refactor Mouse Without Borders log cleanup to use common mechanism Co-authored-by: vanzue <69313318+vanzue@users.noreply.github.com> * Investigate .NET logger cleanup mechanism for old version logs Co-authored-by: vanzue <69313318+vanzue@users.noreply.github.com> * delete in other thread * clear mwb previous folder * slow down the deletion --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <common/utils/winapi_error.h>
|
||||
#include <common/utils/processApi.h>
|
||||
#include <common/utils/elevation.h>
|
||||
#include <common/utils/logger_helper.h>
|
||||
|
||||
HINSTANCE g_hInst_MouseWithoutBorders = 0;
|
||||
|
||||
@@ -409,9 +410,12 @@ public:
|
||||
{
|
||||
app_name = L"MouseWithoutBorders";
|
||||
app_key = app_name;
|
||||
std::filesystem::path logFilePath(PTSettingsHelper::get_module_save_folder_location(app_key));
|
||||
logFilePath.append(LogSettings::mouseWithoutBordersLogPath);
|
||||
Logger::init(LogSettings::mouseWithoutBordersLoggerName, logFilePath.wstring(), PTSettingsHelper::get_log_settings_file_location());
|
||||
|
||||
LoggerHelpers::init_logger(app_key, L"ModuleInterface", LogSettings::mouseWithoutBordersLoggerName);
|
||||
|
||||
std::filesystem::path oldLogPath(PTSettingsHelper::get_module_save_folder_location(app_key));
|
||||
oldLogPath.append("LogsModuleInterface");
|
||||
LoggerHelpers::delete_old_log_folder(oldLogPath);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user