Here’s a sample README.md file for your extension with clear instructions and emoji enhancements for a friendly and professional look:
🚀 RVLogs - Custom Console Logger for VS Code
Easily add customized console.log statements to your code with RVLogs! This extension lets you insert logs formatted with the current date, file name, and variable name — all at the press of a shortcut key.
🌟 Features
• 📝 Custom Console Logging: Automatically format your console.log with the date, file name, and selected variable.
• 🔧 User-Specified Name: Personalize your logs with your name.
• ⚡ Quick Shortcut: Use Ctrl+Cmd+X to add logs instantly after selecting a variable.
📦 Installation
1. Clone this repository or download the .vsix file.
2. Open VS Code and go to the Extensions view (Ctrl+Shift+X).
3. Click on the three dots (...) in the top right and select Install from VSIX….
4. Navigate to the downloaded .vsix file and select it.
Your extension is now installed!
🛠️ Usage
1. Set Your Name
• Open Settings (Ctrl+Shift+P → Preferences: Open Settings (JSON)).
• Add the following to set your name in the settings.json file:
"rvlogs.userName": "YourName"
2. Add a Custom Console Log
• Select a variable in the editor.
• Press Ctrl+Cmd+X (or run the Add Custom Console Log command from the Command Palette).
• A console.log statement will be inserted after the selected line in the format:
console.log("YourName MM/DD/YYYY - filename - variableName", variableName);
✨ Example
With rvlogs.userName set to "Alex", selecting the variable document and pressing Ctrl+Cmd+X would insert:
const document = editor.document;
console.log("Alex 11/14/2024 - myFile.js - document", document);
⚙️ Configuration
• rvlogs.userName: Your name as it should appear in the log statements.
• Default: "User"
• Example: "Alex"
🧑💻 Development
1. Clone the repository.
2. Run npm install to install dependencies.
3. Use F5 to launch the extension in a new VS Code window for testing.
🐞 Troubleshooting
• Ensure that rvlogs.userName is correctly set in settings.json.
• Make sure to select a variable before using Ctrl+Cmd+X.
📄 License
This project is licensed under the MIT License.
With RVLogs, adding informative console.log statements has never been easier!