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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for teams_logger-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dc7fff7eb795eef71f614ae72f99a8d361d9b9ed4402fc2bfd48b4852837511 |
|
MD5 | 678fa6723f5dbc15ae8d23bb336cead9 |
|
BLAKE2b-256 | 86f5da5abd2f2a62ab4a6161536ab7b5f89c92aeb61b9cd7ed8df548e69bc135 |