A lightweight and easy-to-use logging library for Python.
Project description
About
A lightweight and easy-to-use logging library for Python.
- Python: 3.9+
- Runtime dependency:
cobra-color.
Features
- 🚀 Colorful or styled terminal output (
color,style,plain). - 🚀 Optional file persistence with rotation.
- 🚀 Concise exception chaining via
trace_exc. - 🚀 Simple, dependency-light design.
Installation
Stable (once published):
pip install cobra-log
Quick Start
-
Simple warning
from cobra_log import warning warning("warning message")
Example
from cobra_log import (log_init, info, warning, trace_exc)
# Initialize the log system
log_init("log_save_path", display_type="style")
try:
try:
1 / 0 # This will raise a ZeroDivisionError
except Exception as e1:
raise RuntimeError(trace_exc("This is the main exception", e1))
except Exception as e:
warning("A warning occurred.", e)
info("Continuing execution after warning.")
Requirements
- Python >= 3.9
- cobra-color >= 0.2.5
License
See LICENSE in the repository.
Links
- Homepage/Repo: https://github.com/tinchen777/cobra-log.git
- Issues: https://github.com/tinchen777/cobra-log.git/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cobra_log-0.1.1.tar.gz
(8.8 kB
view details)
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 cobra_log-0.1.1.tar.gz.
File metadata
- Download URL: cobra_log-0.1.1.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88b501ac218121f6dc833838836955cc6caffe6fbac78df42486d05bae11c0e0
|
|
| MD5 |
f681fe2fc796993b8fd9f379dfeb7fee
|
|
| BLAKE2b-256 |
925a5b81cf330437f659bcfba326456cc6fcece329c9c0648c06c069b3a10193
|
File details
Details for the file cobra_log-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cobra_log-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7250ea9922805fabc09cb3dc76519ca4735cb819900465958892cda3d57a0107
|
|
| MD5 |
d87d2236540c0678c461c961929c1f79
|
|
| BLAKE2b-256 |
d381c245a199632aa839c287b9a6b68daa0f0c54399db8c2a344363d2ec6c310
|