Log Color Cleaner is a powerful CLI tool designed to remove ANSI color codes from log files, making them easier to read and process.
- 🗂️ Process single log files or entire directories
- 🔄 Recursive directory scanning
- 🌈 Removes all ANSI color codes
- 🔄 Preserves original file structure
- 🌍 Supports multiple languages (currently English and Korean)
- 📊 Displays progress bar for bulk operations
Install Log Color Cleaner globally using npm:
npm install -g log-color-cleaner
clean-log <path-to-log-file-or-directory>
Examples Clean a single log file:
clean-log /path/to/your/logfile.log
Clean all log files in a directory:
clean-log /path/to/your/log/directory
Language Support The tool automatically detects your system language. To manually set the language, use the LANG environment variable:
LANG=ko clean-log /path/to/logs # Korean
LANG=en clean-log /path/to/logs # English
The tool scans the given file or directory for .log files. It reads each log file and removes all ANSI color codes. A new file is created with the suffix '_cleaned' for each processed log file. Original files are left untouched.
Node.js 12.0.0 or higher
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is MIT licensed.
Alex Kang
GitHub: @yourusername LinkedIn: @yourlinkedin
💡 If you find this tool helpful, please consider giving it a star on GitHub and sharing it with others!
- The
overwrite
option in theremoveColorCodes
function now overwrites the original file instead of deleting it. - Added
help
command to provide usage instructions directly from the command line.
- fix localization default en