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
Close
Hashes for gchat_logging_handler-0.0.1.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb55443c50574ce20c2f5240722fe9686488a1dfa85eba8b08a77bb45bf6ba6 |
|
MD5 | 5e88f84a797a964942158f77e0236aab |
|
BLAKE2b-256 | 8cda2d419c5d0c66471af4bec6c298aa655e4169cf000ff1940f28cd03815b09 |
Close
Hashes for gchat_logging_handler-0.0.1.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a805512483d3f7a1c7c7bda1f1ffcdbf1518f8d4b1574b598ef229b1d75f535 |
|
MD5 | ce267f1640ba360ec4c4c7acbe0c3c45 |
|
BLAKE2b-256 | c8228796369ce9a89c0ddb8a75d87dabe03bc237aaebd1cf4ba9dbe8836e7e03 |