Logging handler to send the logs to Google Chat (GChat) room/space.
Project description
GChat Logging Handler
Logging handler to send the logs to Google Chat (GChat) room/space.
Installation
Install with pip:
$ pip install gchat-logging-handler
Features
- Push logs to google chat using the webhook url
- Send a message to google chat using a simple CLI command (also using webhook)
Usage/Examples
In code
import logging
from gchat_logging_handler import GChatHandler
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
gchat_handler = GoogleChatHandler(
webhook_url="https://chat.googleapis.com/v1/spaces/XXXXXXXXX"
)
gchat_handler.setLevel(logging.ERROR)
logger.addHandler(gchat_handler)
logger.debug("DEBUG - not in gchat")
logger.info("INFO - not in gchat")
logger.error("ERROR - in gchat")
CLI Command
$ python -m gchat_logging_handler \
"https://chat.googleapis.com/v1/spaces/XXXXXXXXX" \
"Sending via CLI"
License
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
Built Distribution
File details
Details for the file gchat_logging_handler-0.0.1.dev0.tar.gz
.
File metadata
- Download URL: gchat_logging_handler-0.0.1.dev0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb55443c50574ce20c2f5240722fe9686488a1dfa85eba8b08a77bb45bf6ba6 |
|
MD5 | 5e88f84a797a964942158f77e0236aab |
|
BLAKE2b-256 | 8cda2d419c5d0c66471af4bec6c298aa655e4169cf000ff1940f28cd03815b09 |
File details
Details for the file gchat_logging_handler-0.0.1.dev0-py3-none-any.whl
.
File metadata
- Download URL: gchat_logging_handler-0.0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/1.5.0 colorama/0.4.4 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a805512483d3f7a1c7c7bda1f1ffcdbf1518f8d4b1574b598ef229b1d75f535 |
|
MD5 | ce267f1640ba360ec4c4c7acbe0c3c45 |
|
BLAKE2b-256 | c8228796369ce9a89c0ddb8a75d87dabe03bc237aaebd1cf4ba9dbe8836e7e03 |