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:
1 / 0 # This will raise a ZeroDivisionError
except Exception as e1:
raise RuntimeError("This is the main exception")
except Exception:
warning("A warning occurred.")
info("Continuing execution after warning.")
error("An error message", throw=True)
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.1.0.tar.gz
(12.4 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.1.0-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file cobra_log-1.1.0.tar.gz.
File metadata
- Download URL: cobra_log-1.1.0.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da9d28a375930f180e39f43e872f5894250e716b6a38dcbb3c805460027415a1
|
|
| MD5 |
afcc8f4e29be2fb17ac87788a1a4eac2
|
|
| BLAKE2b-256 |
7be8462e586a818c9992e0ff04e4a90f1bdd45a3b32bbec6b01b0c69118bd16f
|
File details
Details for the file cobra_log-1.1.0-py3-none-any.whl.
File metadata
- Download URL: cobra_log-1.1.0-py3-none-any.whl
- Upload date:
- Size: 12.0 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 |
6433623d6e86adb5694bed93461bcdf8a4054aafd00f309c044d435599da92fb
|
|
| MD5 |
8af1776ecc9edf47a5db7082ec7be006
|
|
| BLAKE2b-256 |
4bce2a40a81e2eeed12fd249ba5aedd69c5ac6ca79a8760fda03b97227dc4e03
|