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+
Features
- 🚀 Vivid and detailed terminal output (need
cobra-color). - 🚀 Optional file persistence with rotation.
- 🚀 Simple, dependency-light design.
Installation
Stable (once published):
pip install cobra-log
Quick Start
-
Simple warning
from cobra_log import warning, log_init log_init("your_log_file.log") warning("warning message")
Example
from cobra_log import (log_init, info, warning, error)
# Initialize the log system
log_init("log_save_path.log", use_color=True)
try:
try:
try:
1 / 0
except Exception as e:
raise error("An error occurred during the test.", throw=None) from e
except Exception as ee:
raise error("An error(TimeoutError) occurred during the test.", throw=TimeoutError) from ee
except Exception:
critical("A critical error occurred during the test.", throw=None)
Requirements
- Python >= 3.9
- (Optional) cobra-color >= 1.3.0
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-1.2.0.tar.gz
(12.9 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
cobra_log-1.2.0-py3-none-any.whl
(13.1 kB
view details)
File details
Details for the file cobra_log-1.2.0.tar.gz.
File metadata
- Download URL: cobra_log-1.2.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c1872e8bceb0f57a23124354301f54f58b46eca312dd62ce3bace3f05adbae1
|
|
| MD5 |
bb7d9ba50888ef51d84a7dc64a25b1b8
|
|
| BLAKE2b-256 |
4d7fe040f828d87b81f3ed59ad31185140abc3c6018437bb8f85c4bcffa1a481
|
File details
Details for the file cobra_log-1.2.0-py3-none-any.whl.
File metadata
- Download URL: cobra_log-1.2.0-py3-none-any.whl
- Upload date:
- Size: 13.1 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 |
339aab2779afdef2b19424289dddb1613200446dc6c025c23964e0a9ff541fe3
|
|
| MD5 |
58fb12c210b87f0ef4410196634bc958
|
|
| BLAKE2b-256 |
46b35d3c325cded8098aac278eaf500cf6ff53a70af6993aa3a87fa253ce9d37
|