https://github.com/dogukanurker/tamga
π Modern, logging utility for Python with multiple output formats and colorful console output.
https://github.com/dogukanurker/tamga
logger pip pip-package tamga
Last synced: 18 days ago
JSON representation
π Modern, logging utility for Python with multiple output formats and colorful console output.
- Host: GitHub
- URL: https://github.com/dogukanurker/tamga
- Owner: DogukanUrker
- License: mit
- Created: 2025-01-14T16:57:31.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-03-17T17:13:36.000Z (about 1 month ago)
- Last Synced: 2025-04-04T17:49:00.397Z (19 days ago)
- Topics: logger, pip, pip-package, tamga
- Language: Python
- Homepage: https://tamga.vercel.app
- Size: 505 KB
- Stars: 68
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Security: docs/SECURITY.md
Awesome Lists containing this project
README
# Tamga [](https://pepy.tech/projects/tamga)
A modern, logging utility for Python with multiple output formats and colorful console output.
[](https://pypi.org/project/tamga/)
tamΒ·ga / noun
An ancient Turkic symbol or seal used for marking ownership, identity, or lineage.
## Features
- π¨ Colorful console output using Tailwind CSS color palette
- π File logging with rotation and backup
- π JSON logging with size limits and backup
- ποΈ SQLite database logging
- π MongoDB integration
- π§ Email notifications for specific log levels
- π API logging support
- π Automatic file rotation and backup
- π― Multiple log levels with customizable colors## Installation
To install the `tamga` package, you can use the following commands based on your requirements:
- Basic installation:
```bash
pip install tamga
```- With API logging support:
```bash
pip install tamga[api]
```- With MongoDB integration:
```bash
pip install tamga[mongo]
```- Full installation with all features:
```bash
pip install tamga[full]
```## Quick Start
```python
from tamga import Tamga# Initialize the logger
logger = Tamga(
logToFile=True,
logToJSON=True,
logToConsole=True
)# Basic logging
logger.info("This is an info message")
logger.warning("This is a warning")
logger.error("This is an error")
logger.success("This is a success message")
logger.debug("This is a debug message")
logger.critical("This is a critical message")# Custom logging
logger.custom("This is a custom message", "CUSTOM", "orange")
```## Advanced Usage
### MongoDB Integration
```python
logger = Tamga(
logToMongo=True,
mongoURI="your_mongodb_uri",
mongoDatabaseName="logs_db",
mongoCollectionName="application_logs"
)
```### Email Notifications
```python
logger = Tamga(
sendMail=True,
smtpServer="smtp.gmail.com",
smtpPort=587,
smtpMail="[email protected]",
smtpPassword="your_password",
smtpReceivers=["[email protected]"],
mailLevels=["CRITICAL", "ERROR"]
)
```### File Rotation and Backup
```python
logger = Tamga(
logToFile=True,
logToJSON=True,
maxLogSize=10, # MB
maxJsonSize=10, # MB
enableBackup=True
)
```### API Integration
```python
logger = Tamga(
logToAPI=True,
apiURL="http://your-api.com/logs"
)
```## Available Log Levels
- INFO (sky blue)
- WARNING (amber)
- ERROR (rose)
- SUCCESS (emerald)
- DEBUG (indigo)
- CRITICAL (red)
- DATABASE (green)
- MAIL (neutral)
- METRIC (cyan)
- TRACE (gray)
- Custom (user-defined)## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Author
- DoΔukan Γrker
- Email: [email protected]
- GitHub: [@dogukanurker](https://github.com/dogukanurker)