https://github.com/wf001/mysqlcolor
Make MySQL general log readable by adding indentation and colorizing queries.
https://github.com/wf001/mysqlcolor
mysql python
Last synced: 4 months ago
JSON representation
Make MySQL general log readable by adding indentation and colorizing queries.
- Host: GitHub
- URL: https://github.com/wf001/mysqlcolor
- Owner: wf001
- Created: 2024-02-17T11:07:57.000Z (over 1 year ago)
- Default Branch: dev
- Last Pushed: 2024-02-17T11:11:53.000Z (over 1 year ago)
- Last Synced: 2025-03-24T00:09:37.285Z (4 months ago)
- Topics: mysql, python
- Language: Python
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mysqlcolor
mysqlcolor is a simple Python script that enhances the readability of log files by adding indentation and colorizing SQL queries. It is particularly useful for developers and system administrators who frequently inspect log files containing SQL queries.## Features
- **Indentation**: Automatically adds indentation to SQL queries and other key log entries, making it easier to identify query blocks.
- **Colorization**: Highlights SQL keywords and query components with different colors, improving visibility and comprehension.
- **Customization**: Easily customize the color scheme and indentation preferences to suit your preferences or project requirements.
- **Real-time Processing**: Supports real-time processing of log files, allowing users to monitor logs as they are updated.| before | after |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|  |  |## Installation
``` bash
git clone https://github.com/wf001/mysqlcolor
```
``` bash
cd mysqlcolor
```
``` bash
pip instatll termcolor
```
Any addtional installation required. Simply download the log_colorizer.py script and run it with Python.## Usage
Simply pipe the log file content to the script to apply indentation and colorization. For example:``` bash
tail -f your_log_file.log | python main.py
```## Requirements
- Python 3.x
- termcolor library (install via pip install termcolor)## License
- This project is licensed under the MIT License - see the LICENSE file for details.