SmartLogger
A lightweight modular logging framework built in Python.
Features
- Modular logging architecture
- Colorized console output (automatic based on log level)
- Multiple log levels (DEBUG, INFO, WARNING, ERROR)
- JSON Formatter for structured logging
- Log rotation by size (
FileHandler) and daily time rotation (TimeRotatingFileHandler) - Custom log format templates
- Exception logging
Installation
Clone the repository and install: pip install -e .
Usage
from smartlogger import Logger
from smartlogger.handlers import ConsoleHandler, TimeRotatingFileHandler
from smartlogger.formatter import Formatter, JSONFormatter
from smartlogger.levels import DEBUG
# Basic Colorized Console Logging
formatter = Formatter("[{time}] [{level}] {message}")
log = Logger(level=DEBUG, formatter=formatter)
log.add_handler(ConsoleHandler(color=True))
log.debug("Tracing execution...")
log.info("Application started")
# Advanced: JSON Logging to a Daily Rotating File
json_log = Logger(level=DEBUG, formatter=JSONFormatter())
json_log.add_handler(TimeRotatingFileHandler("logs/app"))
json_log.error("Database connection failed")
Example Outputs
Console (Colorized automatically)
[2026-05-14 12:00:01] [DEBUG] Tracing execution...
[2026-05-14 12:00:01] [INFO] Application started
JSON Log File (logs/app-2026-05-14.log)
{"time": "2026-05-14 12:00:02", "level": "ERROR", "message": "Database connection failed"}
Architecture
'''
User Code
↓
Logger
↓
Formatter
↓
Handlers
↓
Console / File Output
'''
Project Structure
''' smartlogger/ │ ├── logger.py ├── formatter.py ├── handlers.py ├── levels.py └── init.py '''
Author
Aman Gupta
GitHub: https://github.com/aman-coder-005
Future Improvements
- Additional log handlers (database, network)
- Configurable log levels
- Asynchronous logging
Metadata
Release files for smartlogger-aman 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| smartlogger_aman-0.1.0.tar.gz | 4.1 kB | Without provenance | Details for smartlogger_aman-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| smartlogger_aman-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for smartlogger_aman-0.1.0-py3-none-any.whl |
Total release size: 8.5 kB
Release files / smartlogger_aman-0.1.0.tar.gz
| Download URL | smartlogger_aman-0.1.0.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bede6b7ad764ac746209e716b00de472d4b8255d96b3b6cfe1bd3fb7ed97a1b8
|
|
BLAKE2b-256 checksum How to use checksums |
630ffaa08c8ee24bb8be755a3abb1642c2eb115c240865a7d51a68ab56469bc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Release files / smartlogger_aman-0.1.0-py3-none-any.whl
| Download URL | smartlogger_aman-0.1.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6daf4b7aca3311fed55c82efa2fe1e254cbaaa342ac7f45be29a676d60dcdf99
|
|
BLAKE2b-256 checksum How to use checksums |
9a1bfe20067334fd02034f21fbd20e8cf73f835440f6c0f76601279a7dc69677
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Security for smartlogger-aman 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.