diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f86fe5..04f6c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,13 @@ All notable changes to the "magento-log-viewer" extension will be documented in Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. ## [Unreleased] + +## [1.2.0] - 2024-11-17 ### Added - Comprehensive bug report template - Detailed feature request template +### Changed +- Settings are now saved in the workspace instead of globally in the USER. ## [1.1.0] - 2024-11-16 ### Added diff --git a/README.md b/README.md index a5365dd..bd8314d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,36 @@ # Magento Log Viewer -The Magento Log Viewer extension for Visual Studio Code allows you to easily view and manage log files in your Magento project. This extension provides a tree view of log files, the ability to open and clear log files, and a status bar item showing the number of log entries. - -![Magento Log Viewer Screenshot](resources/screenshot.png) +The Magento Log Viewer extension for Visual Studio Code provides a convenient way to view and manage Magento log files directly in your workspace. ## Features -- **View Log Files**: Displays a tree view of log files in the `var/log` directory of your Magento project. -- **Open Log Files**: Open log files directly in the editor by clicking on them in the tree view. -- **Collapsible Log Lines**: Each log file can be expanded to view individual lines. -- **Clear Log Files**: Clear all log files with a single command. -- **Status Bar Item**: Shows the number of log entries in the status bar. - -## Requirements +- Tree view of log files from Magento's `var/log` directory +- Grouped log entries by severity level (ERROR, WARN, DEBUG, INFO) +- Direct file opening with line highlighting +- One-click log file clearing +- Status bar showing total log entries +- Real-time log file monitoring -- Visual Studio Code version 1.95.0 or higher. -- A Magento project with log files located in the `var/log` directory. +## Setup -## Getting Started +1. Install the extension from VS Code marketplace +2. Open your Magento project workspace +3. When prompted, confirm it's a Magento project +4. Select your Magento root directory +5. The extension will now load your log files -1. **Install the extension**: Install the Magento Log Viewer extension from the Visual Studio Code marketplace. -2. **Open your Magento project**: Open your Magento project in Visual Studio Code. -3. **Configure the extension**: When you open a workspace, the extension will prompt you to specify if it is a Magento project. If you select "Yes", you will be prompted to select the Magento root folder. -4. **View log files**: The log files will be displayed in the tree view under the "Magento Log Viewer" activity bar. -5. **Open log files**: Click on any log file in the tree view to open it in the editor. -6. **Expand log files**: Click on the arrow next to a log file to expand and view individual lines. -7. **Clear log files**: Use the "Clear all Logs" command to delete all log files in the `var/log` directory. +Note: Settings are workspace-specific, allowing different configurations for each Magento project. ## Usage -1. **Install the extension**: Install the Magento Log Viewer extension from the Visual Studio Code marketplace. -2. **Configure the extension**: When you open a workspace, the extension will prompt you to specify if it is a Magento project. If you select "Yes", you will be prompted to select the Magento root folder. -3. **View log files**: The log files will be displayed in the tree view under the "Magento Log Viewer" activity bar. -4. **Open log files**: Click on any log file in the tree view to open it in the editor. -5. **Expand log files**: Click on the arrow next to a log file to expand and view individual lines. -6. **Clear log files**: Use the "Clear all Logs" command to delete all log files in the `var/log` directory. +- **View Logs**: Open the Magento Log Viewer sidebar (M logo) +- **Clear Logs**: Click the trash icon in the view header +- **Refresh**: Click the refresh icon or wait for auto-update +- **Navigate**: Click on log entries to jump to specific lines +- **Filter**: Expand log files to see entries grouped by severity + +## Requirements + +- VS Code 1.95.0+ **Enjoy!** diff --git a/package.json b/package.json index 38b3575..a29c8b2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "magento-log-viewer", "displayName": "Magento Log Viewer", "description": "A Visual Studio Code extension to view and manage Magento log files.", - "version": "1.1.0", + "version": "1.2.0", "publisher": "MathiasElle", "icon": "resources/logo.png", "repository": { @@ -44,12 +44,14 @@ "type": "string", "enum": ["Yes", "No", "Please select"], "default": "Please select", - "description": "This is a Magento project" + "description": "This is a Magento project", + "scope": "resource" }, "magentoLogViewer.magentoRoot": { "type": "string", "default": "", - "description": "Path to the Magento root folder" + "description": "Path to the Magento root folder", + "scope": "resource" } } }, diff --git a/src/extension.ts b/src/extension.ts index abd61ab..a9bf5a0 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -16,9 +16,9 @@ export function activate(context: vscode.ExtensionContext) { const defaultUri = workspaceFolders && workspaceFolders.length > 0 ? workspaceFolders[0].uri : undefined; vscode.window.showOpenDialog({ defaultUri, canSelectFolders: true, canSelectMany: false, openLabel: 'Select Magento Root Folder' }).then(folderUri => { if (folderUri && folderUri[0]) { - config.update('magentoLogViewer.magentoRoot', folderUri[0].fsPath, vscode.ConfigurationTarget.Global).then(() => { + config.update('magentoLogViewer.magentoRoot', folderUri[0].fsPath, vscode.ConfigurationTarget.Workspace).then(() => { vscode.window.showInformationMessage('Magento root folder successfully saved!'); - config.update('magentoLogViewer.isMagentoProject', 'Yes', vscode.ConfigurationTarget.Global); + config.update('magentoLogViewer.isMagentoProject', 'Yes', vscode.ConfigurationTarget.Workspace); activateExtension(context, folderUri[0].fsPath); }); } @@ -26,7 +26,7 @@ export function activate(context: vscode.ExtensionContext) { } }); } else { - config.update('magentoLogViewer.isMagentoProject', selection, vscode.ConfigurationTarget.Global); + config.update('magentoLogViewer.isMagentoProject', selection, vscode.ConfigurationTarget.Workspace); } }); } else if (isMagentoProject === 'Yes') {