Microsoft Teams logging handler for Python
Project description
Python logging handler for Microsoft Teams web hook integration with simple configuration.
Installation
pip install teams-logger
Examples
Simple
import logging
from teams_handler import TeamsHandler
th = TeamsHandler(url='YOUR_WEB_HOOK_URL', level=logging.INFO)
logging.basicConfig(handlers=[th])
logging.warning('warn message')
Using Card Formatter
import logging
from teams_handler import TeamsHandler, Office365CardFormatter
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
th = TeamsHandler(url='YOUR_WEB_HOOK_URL', level=logging.INFO)
th.setLevel(logging.DEBUG)
logger.addHandler(th)
cf = Office365CardFormatter(facts=["name", "levelane", "lineno"])
th.setFormatter(cf)
logger.debug('debug message')
logger.info('info message')
logger.warn('warn message')
logger.error('error message')
logger.critical('critical message')
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
teams-logger-0.2.0.tar.gz
(2.5 kB
view hashes)
Built Distribution
Close
Hashes for teams_logger-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2830e2a2b699943bff399fd30f3bb452e75c1748f9b2e4fae1afcb4efa68bdb6 |
|
MD5 | 9a5d695e5f6b0a13c632a281687c8fd8 |
|
BLAKE2b-256 | f50b05a9c95e77b619a6e23a15a30b3f73e14aa484b09562054d8cc8b560a6f5 |