📋 Activity Logger
Activity Logger is a lightweight Visual Studio Code extension that automatically logs your coding session activities — including file edits, file switches, and script executions — into a human-readable log file saved to your system.
🚀 Features
Session Logging
Records session start and end times with timestamps.
Edit Logging
Logs edits to files, throttled to once every 10 seconds per file.
File Switch Detection
Detects when you switch between different files in the editor.
Run Detection
Detects when a supported file (e.g., .py
, .js
, .ts
, .java
, etc.) is run and logs execution status, output, and mode (normal/debug).
Open Log File Command
Open the session log file directly in VS Code via the command palette.
📂 Log File Location
The log file is stored at:
~/Documents/Activity-Session-Log.txt
This file accumulates all activity logs across sessions.
---
## 🛠️ Supported File Types for Execution Logging
The extension can detect and log run activity for the following file types:
- Python (`.py`)
- JavaScript (`.js`)
- TypeScript (`.ts`)
- Java (`.java`)
- C/C++ (`.c`, `.cpp`)
- Go (`.go`)
- Rust (`.rs`)
- Ruby (`.rb`)
- PHP (`.php`)
- Perl (`.pl`)
> Note: Actual file execution is attempted, so make sure interpreters/compilers are installed and available in your system PATH.
---
## 📦 Installation
1. Clone or download this repository.
2. Run `npm install` to install dependencies.
3. Run `npm run compile` to build the extension.
4. Press `F5` in VS Code to launch a development window with the extension activated.
---
## 📘 Usage
Once installed, the extension will:
- Start logging when VS Code finishes startup.
- Detect and log:
- File switches.
- Edits (once per 10 seconds per file).
- File runs (via Save + match extension).
- Debug session starts.
### 📂 Open the Log File
Open the Command Palette (`Ctrl+Shift+P` or `Cmd+Shift+P`), and run:
Session Logger: Open Session Log File
---
## 🧱 Project Structure
src/
├── extension.ts // Main activation file
├── runHandler.ts // Handles run detection and execution
├── switchHandler.ts // Tracks file switches
├── editHandler.ts // Handles document edits
├── utils.ts // Utility functions for logging and file operations
---
## 📜 Sample Log Output
Session started at:2025/06/24 10:15:00
ibrahim has switched into the following file: /Users/ibrahim/project/app.py, at this time: 2025/06/24 10:15:10
Edit:/Users/ibrahim/project/app.py, Time: 2025/06/24 10:15:22
ibrahim ran file: /Users/ibrahim/project/app.py in normal mode with result: success at 2025/06/24 10:15:30
Session ended at:2025/06/24 10:45:00
---
## ✅ Requirements
- Visual Studio Code `v1.74.0` or higher
- Node.js + NPM (for development)
- Supported language interpreters (Python, Node.js, etc.) installed locally
---
## 🧑💻 Developer Notes
- You can add or remove supported file types in `runHandler.ts`.
- Logs are plain text and stored persistently between sessions.
- Modify the timeout and throttling behaviors as needed for performance tuning.
---
## 📝 License
This extension is released under the [MIT License](https://github.com/DARKNESSPROF/codalyzer/blob/HEAD/LICENSE).
---
## 🙌 Acknowledgements
Developed with ❤️ to help track coding activities and support productivity insights.
---
## 📧 Contact
For questions or suggestions, feel free to reach out or submit issues on the repository.