From 03bc72c4369311176fa4b66b1b494478f331919f Mon Sep 17 00:00:00 2001 From: Bennett Blodinger Date: Sun, 13 Apr 2025 18:20:43 -0500 Subject: [PATCH] Change log extension from .txt => .log (#33813) * Change log extension From .txt to .log * Also add workspace logs --------- Co-authored-by: Jaime Bernardo --- src/common/AllExperiments/Logger.cs | 2 +- src/common/ManagedCommon/Logger.cs | 2 +- src/common/logger/logger_settings.h | 60 ++++++++++++++--------------- src/common/utils/logger_helper.h | 2 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/common/AllExperiments/Logger.cs b/src/common/AllExperiments/Logger.cs index 7604618bdf..b9e1f20969 100644 --- a/src/common/AllExperiments/Logger.cs +++ b/src/common/AllExperiments/Logger.cs @@ -25,7 +25,7 @@ namespace AllExperiments } // Using InvariantCulture since this is used for a log file name - var logFilePath = Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt"); + var logFilePath = Path.Combine(ApplicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".log"); Trace.Listeners.Add(new TextWriterTraceListener(logFilePath)); diff --git a/src/common/ManagedCommon/Logger.cs b/src/common/ManagedCommon/Logger.cs index b67d63c3b5..cd85d500e1 100644 --- a/src/common/ManagedCommon/Logger.cs +++ b/src/common/ManagedCommon/Logger.cs @@ -54,7 +54,7 @@ namespace ManagedCommon Directory.CreateDirectory(applicationLogPath); } - var logFilePath = Path.Combine(applicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".txt"); + var logFilePath = Path.Combine(applicationLogPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".log"); Trace.Listeners.Add(new TextWriterTraceListener(logFilePath)); diff --git a/src/common/logger/logger_settings.h b/src/common/logger/logger_settings.h index dab7ad64a2..c880614237 100644 --- a/src/common/logger/logger_settings.h +++ b/src/common/logger/logger_settings.h @@ -8,49 +8,49 @@ struct LogSettings inline const static std::wstring logLevelOption = L"logLevel"; inline const static std::string runnerLoggerName = "runner"; inline const static std::wstring logPath = L"Logs\\"; - inline const static std::wstring runnerLogPath = L"RunnerLogs\\runner-log.txt"; + inline const static std::wstring runnerLogPath = L"RunnerLogs\\runner-log.log"; inline const static std::string actionRunnerLoggerName = "action-runner"; - inline const static std::wstring actionRunnerLogPath = L"RunnerLogs\\action-runner-log.txt"; + inline const static std::wstring actionRunnerLogPath = L"RunnerLogs\\action-runner-log.log"; inline const static std::string updateLoggerName = "update"; - inline const static std::wstring updateLogPath = L"UpdateLogs\\update-log.txt"; + inline const static std::wstring updateLogPath = L"UpdateLogs\\update-log.log"; inline const static std::string fileExplorerLoggerName = "FileExplorer"; - inline const static std::wstring fileExplorerLogPath = L"Logs\\file-explorer-log.txt"; + inline const static std::wstring fileExplorerLogPath = L"Logs\\file-explorer-log.log"; inline const static std::string gcodePrevLoggerName = "GcodePrevHandler"; - inline const static std::wstring gcodePrevLogPath = L"logs\\FileExplorer_localLow\\GcodePreviewHandler\\gcode-prev-handler-log.txt"; + inline const static std::wstring gcodePrevLogPath = L"logs\\FileExplorer_localLow\\GcodePreviewHandler\\gcode-prev-handler-log.log"; inline const static std::string gcodeThumbLoggerName = "GcodeThumbnailProvider"; - inline const static std::wstring gcodeThumbLogPath = L"logs\\FileExplorer_localLow\\GcodeThumbnailProvider\\gcode-thumbnail-provider-log.txt"; + inline const static std::wstring gcodeThumbLogPath = L"logs\\FileExplorer_localLow\\GcodeThumbnailProvider\\gcode-thumbnail-provider-log.log"; inline const static std::string mdPrevLoggerName = "MDPrevHandler"; - inline const static std::wstring mdPrevLogPath = L"logs\\FileExplorer_localLow\\MDPrevHandler\\md-prev-handler-log.txt"; + inline const static std::wstring mdPrevLogPath = L"logs\\FileExplorer_localLow\\MDPrevHandler\\md-prev-handler-log.log"; inline const static std::string monacoPrevLoggerName = "MonacoPrevHandler"; - inline const static std::wstring monacoPrevLogPath = L"logs\\FileExplorer_localLow\\MonacoPrevHandler\\monaco-prev-handler-log.txt"; + inline const static std::wstring monacoPrevLogPath = L"logs\\FileExplorer_localLow\\MonacoPrevHandler\\monaco-prev-handler-log.log"; inline const static std::string pdfPrevLoggerName = "PdfPrevHandler"; - inline const static std::wstring pdfPrevLogPath = L"logs\\FileExplorer_localLow\\PdfPrevHandler\\pdf-prev-handler-log.txt"; + inline const static std::wstring pdfPrevLogPath = L"logs\\FileExplorer_localLow\\PdfPrevHandler\\pdf-prev-handler-log.log"; inline const static std::string pdfThumbLoggerName = "PdfThumbnailProvider"; - inline const static std::wstring pdfThumbLogPath = L"logs\\FileExplorer_localLow\\PdfThumbnailProvider\\pdf-thumbnail-provider-log.txt"; + inline const static std::wstring pdfThumbLogPath = L"logs\\FileExplorer_localLow\\PdfThumbnailProvider\\pdf-thumbnail-provider-log.log"; inline const static std::string qoiPrevLoggerName = "QoiPrevHandler"; - inline const static std::wstring qoiPrevLogPath = L"logs\\FileExplorer_localLow\\QoiPreviewHandler\\qoi-prev-handler-log.txt"; + inline const static std::wstring qoiPrevLogPath = L"logs\\FileExplorer_localLow\\QoiPreviewHandler\\qoi-prev-handler-log.log"; inline const static std::string qoiThumbLoggerName = "QoiThumbnailProvider"; - inline const static std::wstring qoiThumbLogPath = L"logs\\FileExplorer_localLow\\QoiThumbnailProvider\\qoi-thumbnail-provider-log.txt"; + inline const static std::wstring qoiThumbLogPath = L"logs\\FileExplorer_localLow\\QoiThumbnailProvider\\qoi-thumbnail-provider-log.log"; inline const static std::string stlThumbLoggerName = "StlThumbnailProvider"; - inline const static std::wstring stlThumbLogPath = L"logs\\FileExplorer_localLow\\StlThumbnailProvider\\stl-thumbnail-provider-log.txt"; + inline const static std::wstring stlThumbLogPath = L"logs\\FileExplorer_localLow\\StlThumbnailProvider\\stl-thumbnail-provider-log.log"; inline const static std::string svgPrevLoggerName = "SvgPrevHandler"; - inline const static std::wstring svgPrevLogPath = L"logs\\FileExplorer_localLow\\SvgPrevHandler\\svg-prev-handler-log.txt"; + inline const static std::wstring svgPrevLogPath = L"logs\\FileExplorer_localLow\\SvgPrevHandler\\svg-prev-handler-log.log"; inline const static std::string svgThumbLoggerName = "SvgThumbnailProvider"; - inline const static std::wstring svgThumbLogPath = L"logs\\FileExplorer_localLow\\SvgThumbnailProvider\\svg-thumbnail-provider-log.txt"; + inline const static std::wstring svgThumbLogPath = L"logs\\FileExplorer_localLow\\SvgThumbnailProvider\\svg-thumbnail-provider-log.log"; inline const static std::string launcherLoggerName = "launcher"; - inline const static std::wstring launcherLogPath = L"LogsModuleInterface\\launcher-log.txt"; + inline const static std::wstring launcherLogPath = L"LogsModuleInterface\\launcher-log.log"; inline const static std::string mouseWithoutBordersLoggerName = "mouseWithoutBorders"; - inline const static std::wstring mouseWithoutBordersLogPath = L"LogsModuleInterface\\mouseWithoutBorders-log.txt"; - inline const static std::wstring awakeLogPath = L"Logs\\awake-log.txt"; - inline const static std::wstring powerAccentLogPath = L"quick-accent-log.txt"; + inline const static std::wstring mouseWithoutBordersLogPath = L"LogsModuleInterface\\mouseWithoutBorders-log.log"; + inline const static std::wstring awakeLogPath = L"Logs\\awake-log.log"; + inline const static std::wstring powerAccentLogPath = L"quick-accent-log.log"; inline const static std::string fancyZonesLoggerName = "fancyzones"; - inline const static std::wstring fancyZonesLogPath = L"fancyzones-log.txt"; + inline const static std::wstring fancyZonesLogPath = L"fancyzones-log.log"; inline const static std::wstring fancyZonesOldLogPath = L"FancyZonesLogs\\"; // needed to clean up old logs inline const static std::string shortcutGuideLoggerName = "shortcut-guide"; - inline const static std::wstring shortcutGuideLogPath = L"ShortcutGuideLogs\\shortcut-guide-log.txt"; - inline const static std::wstring powerOcrLogPath = L"Logs\\text-extractor-log.txt"; + inline const static std::wstring shortcutGuideLogPath = L"ShortcutGuideLogs\\shortcut-guide-log.log"; + inline const static std::wstring powerOcrLogPath = L"Logs\\text-extractor-log.log"; inline const static std::string keyboardManagerLoggerName = "keyboard-manager"; - inline const static std::wstring keyboardManagerLogPath = L"Logs\\keyboard-manager-log.txt"; + inline const static std::wstring keyboardManagerLogPath = L"Logs\\keyboard-manager-log.log"; inline const static std::string findMyMouseLoggerName = "find-my-mouse"; inline const static std::string mouseHighlighterLoggerName = "mouse-highlighter"; inline const static std::string mouseJumpLoggerName = "mouse-jump"; @@ -60,22 +60,22 @@ struct LogSettings inline const static std::string alwaysOnTopLoggerName = "always-on-top"; inline const static std::string powerOcrLoggerName = "TextExtractor"; inline const static std::string fileLocksmithLoggerName = "FileLocksmith"; - inline const static std::wstring alwaysOnTopLogPath = L"always-on-top-log.txt"; + inline const static std::wstring alwaysOnTopLogPath = L"always-on-top-log.log"; inline const static std::string hostsLoggerName = "hosts"; - inline const static std::wstring hostsLogPath = L"Logs\\hosts-log.txt"; + inline const static std::wstring hostsLogPath = L"Logs\\hosts-log.log"; inline const static std::string registryPreviewLoggerName = "registrypreview"; inline const static std::string cropAndLockLoggerName = "crop-and-lock"; - inline const static std::wstring registryPreviewLogPath = L"Logs\\registryPreview-log.txt"; + inline const static std::wstring registryPreviewLogPath = L"Logs\\registryPreview-log.log"; inline const static std::string environmentVariablesLoggerName = "environment-variables"; - inline const static std::wstring cmdNotFoundLogPath = L"Logs\\cmd-not-found-log.txt"; + inline const static std::wstring cmdNotFoundLogPath = L"Logs\\cmd-not-found-log.log"; inline const static std::string cmdNotFoundLoggerName = "cmd-not-found"; inline const static std::string newLoggerName = "NewPlus"; inline const static std::string workspacesLauncherLoggerName = "workspaces-launcher"; - inline const static std::wstring workspacesLauncherLogPath = L"workspaces-launcher-log.txt"; + inline const static std::wstring workspacesLauncherLogPath = L"workspaces-launcher-log.log"; inline const static std::string workspacesWindowArrangerLoggerName = "workspaces-window-arranger"; - inline const static std::wstring workspacesWindowArrangerLogPath = L"workspaces-window-arranger-log.txt"; + inline const static std::wstring workspacesWindowArrangerLogPath = L"workspaces-window-arranger-log.log"; inline const static std::string workspacesSnapshotToolLoggerName = "workspaces-snapshot-tool"; - inline const static std::wstring workspacesSnapshotToolLogPath = L"workspaces-snapshot-tool-log.txt"; + inline const static std::wstring workspacesSnapshotToolLogPath = L"workspaces-snapshot-tool-log.log"; inline const static std::string zoomItLoggerName = "zoom-it"; inline const static int retention = 30; std::wstring logLevel; diff --git a/src/common/utils/logger_helper.h b/src/common/utils/logger_helper.h index c2207525e3..2deec22155 100644 --- a/src/common/utils/logger_helper.h +++ b/src/common/utils/logger_helper.h @@ -91,7 +91,7 @@ namespace LoggerHelpers currentFolder.append(get_product_version()); auto logsPath = currentFolder; - logsPath.append(L"log.txt"); + logsPath.append(L"log.log"); Logger::init(loggerName, logsPath.wstring(), PTSettingsHelper::get_log_settings_file_location()); delete_other_versions_log_folders(rootFolder.wstring(), currentFolder);