Skip to content

๐ŸŒˆ Modern, logging utility for Python with multiple output formats and colorful console output.

License

Notifications You must be signed in to change notification settings

DogukanUrker/Tamga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

67 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Tamga PyPI Downloads

A modern, logging utility for Python with multiple output formats and colorful console output.

Installation

tamยทga / noun
An ancient Turkic symbol or seal used for marking ownership, identity, or lineage.

Terminal

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

pip install tamga

Quick Start

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

logger = Tamga(
    logToMongo=True,
    mongoURI="your_mongodb_uri",
    mongoDatabaseName="logs_db",
    mongoCollectionName="application_logs"
)

Email Notifications

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

logger = Tamga(
    logToFile=True,
    logToJSON=True,
    maxLogSize=10,  # MB
    maxJsonSize=10,  # MB
    enableBackup=True
)

API Integration

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 file for details.

Author

About

๐ŸŒˆ Modern, logging utility for Python with multiple output formats and colorful console output.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Languages