Log Generator 3000 - A modular log generation tool
Project description
๐ Log Generator 3000 (LG3K)
๐ The ultimate modular log generation tool, designed for modern systems! ๐
Installation
From PyPI (Recommended)
The easiest way to install LG3K is from PyPI:
pip install lg3k
This will install the latest stable version with all required dependencies.
From Source (Development)
For the latest development version or contributing:
git clone https://github.com/mikl0s/LG3K.git
cd LG3K
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -r requirements-dev.txt
pip install -e .
pre-commit install
Requirements
- Python 3.12 or later
- Dependencies are automatically installed with pip
- Optional:
richpackage for enhanced display
About
Welcome to Log Generator 3000โa fully modular log generation tool designed to simplify testing and monitoring across diverse systems. It supports web servers, APIs, databases, firewalls, and more.
This project was conceptualized, developed, and published entirely on an iPad during a Saturday evening of footballโand yes, the team we were rooting for won! ๐
Curious about the full story? Read more here.
Contributing
We believe in the power of community! LG3K becomes more valuable with each new contribution, whether it's adding new log types, improving existing ones, or enhancing the core functionality.
Ways to Contribute
-
Add New Log Types ๐
- Create new modules for different systems
- Enhance existing log formats
- Add more realistic log patterns
-
Improve Core Features ๐ ๏ธ
- Enhance performance
- Add new configuration options
- Improve error handling
-
Documentation ๐
- Improve documentation
- Add examples
- Write tutorials
-
Testing ๐งช
- Add unit tests
- Report bugs
- Suggest improvements
Getting Started with Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature-name) - Set up development environment:
python -m venv venv source venv/bin/activate # or `venv\Scripts\activate` on Windows pip install -r requirements-dev.txt # Installs all development dependencies pip install -e . # Install package in development mode pre-commit install
- Run tests:
pytest # Runs tests with coverage report
- Make your changes (the pre-commit hooks will ensure code quality)
- Write tests if applicable
- Update documentation if needed
- Commit your changes (
git commit -m 'Add feature') - Push to your branch (
git push origin feature-name) - Open a Pull Request
Development Guidelines
- Code is formatted with Black (88 characters line length)
- Imports are sorted with isort
- Code quality is checked with Flake8
- All functions and modules have docstrings
- Changes are covered by tests (when applicable)
๐ Project Structure
lg3k/
โโโ __init__.py # Package initialization
โโโ modules/ # Folder containing all log generation modules
โ โโโ web_server.py # Module for web server logs
โ โโโ database.py # Module for database logs
โ โโโ api.py # Module for API logs
โ โโโ firewall.py # Module for firewall logs
โ โโโ nas.py # Module for NAS logs
โ โโโ os.py # Module for OS logs
โ โโโ network.py # Module for network logs
โ โโโ printer.py # Module for printer logs
โ โโโ smarthome.py # Module for smart home devices and IoT
โโโ utils/ # Folder containing utility functions
โ โโโ config.py # Utilities for configuration handling
โ โโโ progress.py # Utilities for progress and threading
โ โโโ timestamp.py # Timestamp generation utilities
โจ Features
- Dynamic Module Loading: Easily add new log types by creating a module in the
modules/folder. - Scalable and Modular: Keep your codebase clean and maintainable by separating log logic into distinct files.
- Docker-Style Progress: Real-time progress tracking with Docker-like display for each module.
- Smart Home Support: Generate logs for IoT devices, ESP32/ESP8266, Zigbee/Z-Wave, and security cameras.
- High Volume: Generate up to 1,000,000 log entries per module.
- Rich UI: Beautiful, real-time progress bar for generating logs (or use
--simplemode for minimal output). - Fully Configurable: Modify the configuration file to control active services, total logs, threading, and more.
- JSON Output Mode: Get structured output in JSON format for easy parsing and automation.
- Configuration Generation: Generate default configuration files with
--generate-config. - Code Quality: Enforced by Black, isort, and Flake8 through pre-commit hooks.
- 100% Test Coverage: Comprehensive test suite ensuring reliability.
Getting Started
Prerequisites
- Python 3.12 or later
- For users:
pip install -r requirements.txt
- For developers:
pip install -r requirements-dev.txt pip install -e . pre-commit install
Quick Start
-
Install the package:
pip install lg3k
-
Generate logs:
lg3k --count 1000 --threads 4
-
View help:
lg3k --help
Developer Guide
Looking to integrate LG3K into your application or AI model? Check out our Developer Guide for:
- ๐ง Programmatic usage examples
- ๐ค AI integration patterns
- ๐ Log format specifications
- โก Performance optimization tips
- ๐งช Integration testing strategies
- ๐ ๏ธ Configuration file generation
- ๐ JSON output mode usage
Available Modules
-
Infrastructure
web_server- Web server access logsdatabase- Database operationsapi- API endpoint logsfirewall- Security eventsnas- Storage operationsos- System logsnetwork- Network trafficprinter- Print jobs
-
Smart Home & IoT
- Smart home devices (thermostats, lights, sensors)
- ESP32/ESP8266 microcontrollers
- Zigbee/Z-Wave devices
- Security cameras and doorbells
๐ Sample Output
Docker-Style Progress Display
1ff5d2e3: web_server [=========> ] 50.0%
5520ebfb: database [==========] Complete
e9c8c5d6: api [> ] Waiting
7a1b3c4d: smarthome [=======> ] 35.0%
...
Rich UI (Default Mode)
[Thread 1] โโโโโโโ 90% (90/100 logs)
[Thread 2] โโโโโโโโ 100% (100/100 logs) Completed: logs_part2.json
...
Simple Mode
Starting log generation for 1000 logs across 10 files.
Thread 1 completed generating ./logs/logs_part1.json
Thread 2 completed generating ./logs/logs_part2.json
...
JSON Output Mode
Use the --json flag for structured output in a single line (ideal for parsing):
lg3k --count 1000 --threads 4 --json
This outputs a single line of JSON with detailed information (formatted here for readability):
{
"success": true,
"logs_generated": 1000,
"time_taken": 1.23,
"files": ["logs/part1.json", "logs/part2.json"],
"stats": {
"total_files": 2,
"avg_logs_per_file": 500,
"total_size_bytes": 12345
},
"timing": {
"start_time": "2024-03-22T12:34:56.789012",
"duration_seconds": 1.23,
"logs_per_second": 813.0
},
"config": {
"output_directory": "logs",
"file_format": ".json"
}
}
In case of errors (also single-line output):
{
"success": false,
"logs_generated": 0,
"time_taken": 0.0,
"files": [],
"error": {
"message": "Error message here",
"type": "ErrorType"
}
}
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ฌ Questions?
Feel free to open an issue or contact us at lg3k@dataloes.dk.
๐ Show Your Support
If you love Log Generator 3000, give us a โญ on GitHub! Spread the word and help others test their systems with ease.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lg3k-0.6.6.tar.gz.
File metadata
- Download URL: lg3k-0.6.6.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e5af7bfba7418daa73e51c39d5b3fd259953a8ecd76e9ae16fb20b7a5e10d4f9
|
|
| MD5 |
d15b61bfbd4ae0a57808b8d360f7a219
|
|
| BLAKE2b-256 |
9e3bcd6102e100ec661f4f8161268a3ecef0fc85b2aec6f6f16dbba6818864fb
|
Provenance
The following attestation bundles were made for lg3k-0.6.6.tar.gz:
Publisher:
release.yml on mikl0s/LG3K
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lg3k-0.6.6.tar.gz -
Subject digest:
e5af7bfba7418daa73e51c39d5b3fd259953a8ecd76e9ae16fb20b7a5e10d4f9 - Sigstore transparency entry: 157381863
- Sigstore integration time:
-
Permalink:
mikl0s/LG3K@90c1b16e1c3fc38c0e9c3e77a41467ef5d0101cc -
Branch / Tag:
refs/tags/v0.6.6 - Owner: https://github.com/mikl0s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@90c1b16e1c3fc38c0e9c3e77a41467ef5d0101cc -
Trigger Event:
push
-
Statement type:
File details
Details for the file lg3k-0.6.6-py3-none-any.whl.
File metadata
- Download URL: lg3k-0.6.6-py3-none-any.whl
- Upload date:
- Size: 23.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53363c6dde88de14e70c56a004019c44765d4b7813d3ffa675b8719549035fa6
|
|
| MD5 |
c40669694475144a88adcff12eab1bfb
|
|
| BLAKE2b-256 |
eb85311e183888a0b768d937f96c52d06679bd67eaff3d91170d9bec6003fd70
|
Provenance
The following attestation bundles were made for lg3k-0.6.6-py3-none-any.whl:
Publisher:
release.yml on mikl0s/LG3K
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lg3k-0.6.6-py3-none-any.whl -
Subject digest:
53363c6dde88de14e70c56a004019c44765d4b7813d3ffa675b8719549035fa6 - Sigstore transparency entry: 157381864
- Sigstore integration time:
-
Permalink:
mikl0s/LG3K@90c1b16e1c3fc38c0e9c3e77a41467ef5d0101cc -
Branch / Tag:
refs/tags/v0.6.6 - Owner: https://github.com/mikl0s
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@90c1b16e1c3fc38c0e9c3e77a41467ef5d0101cc -
Trigger Event:
push
-
Statement type: