httpheader for logging on async
Project description
aiohandler
aiohandler = aiohttp http handler
aiohandler is a logging extension module.
By using this module, logs can be sent by webhook.
installing
Install and update using pip:
pip install aiohandler
A simple example.
Enter the parameters required for sending the webhook in the body.
import asyncio
import logging
import aiohandler
WEBHOOK_URL = "Your webhook url"
logger = logging.getLogger()
handler = aiohandler.AioHTTPHandler(WEBHOOK_URL, method="POST", body="content")
logger.addHandler(handler)
loop = asyncio.get_event_loop()
async def main():
print("hello!")
logging.info('info')
logging.debug('debug')
logging.error('error')
await asyncio.sleep(1)
logging.warning('warning')
logging.critical('critical')
print("hello world!")
if __name__ == "__main__":
loop.create_task(main())
loop.run_forever()
Thank you to everyone who Helped me (#^^#)
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
aiohandler-0.1.0.tar.gz
(2.4 kB
view details)
Built Distribution
File details
Details for the file aiohandler-0.1.0.tar.gz
.
File metadata
- Download URL: aiohandler-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a35109ef666190915f32c52c45fb1de1e261defa03b013f60202d6783c3f7b6d |
|
MD5 | 98d6d242428f4a534f16cf4fd5eeefe8 |
|
BLAKE2b-256 | cbc6dbefadbecef67d429aed9732433bdae9be3eb5ad531b97f7763328908c99 |
File details
Details for the file aiohandler-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: aiohandler-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25b38dd59ded469f38e7657ad0a02a51d7321c6e6a68b8439e5930e3fda300a1 |
|
MD5 | b6a2efd3a66bb2245c1518835619cf26 |
|
BLAKE2b-256 | 3a10d3f011e57b4974a539906b4cad6645d3625da7583d445b842ca16dd5823d |