Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/albertnieto/qcml-logging
A Python library for advanced logging with support for multiple outputs and Slack integration. Designed for QCML.
https://github.com/albertnieto/qcml-logging
logging-library python slack
Last synced: 13 days ago
JSON representation
A Python library for advanced logging with support for multiple outputs and Slack integration. Designed for QCML.
- Host: GitHub
- URL: https://github.com/albertnieto/qcml-logging
- Owner: albertnieto
- License: apache-2.0
- Created: 2024-08-16T21:21:29.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-16T23:04:11.000Z (3 months ago)
- Last Synced: 2024-10-04T21:36:02.598Z (about 1 month ago)
- Topics: logging-library, python, slack
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# QCML Logging Library
QCML Logging is a Python library that provides advanced logging setup with support for multiple outputs (terminal, file) and Slack integration. It includes features like color-coded logs, JSON formatting, and contextual information.
## Installation
You can install the library using pip:
```bash
pip install qcml-logging
```## Usage
Here’s an example of how to set up logging:
```python
import qcml_loggingcontext_info = {
'user_id': '12345',
'session_id': 'abcde'
}slack_credentials = ["your-slack-token", "#your-channel"]
qcml_logging.log_setup(
level="DEBUG",
output="both",
logs_path="my_logs",
use_json=False,
keyword_filters=["error", "critical"],
use_color=True,
asynchronous=True,
add_context=True,
context_info=context_info,
slack_notify=True,
slack_credentials=slack_credentials
)logging.debug("This is a debug message.")
```