Transfer logs acquired by logging module to discord with webhook!
Project description
#discord_logging
discord_logging is a logging extension module.
By using this module, logs can be sent by webhook.
installing
Install and update using pip:
pip install discord_logging
A simple example.
import asyncio
import logging
import discord_logging
WEBHOOK_URL = "Your webhook url"
logger = logging.getLogger()
handler = discord_logging.Discord_Handler(WEBHOOK_URL)
logger.addHandler(handler)
loop = asyncio.get_event_loop()
async def main():
logging.info('info')
logging.debug('debug')
logging.error('error')
logging.warning('warning')
logging.critical('critical')
print("hello world!")
if __name__ == "__main__":
loop.create_task(main())
loop.run_forever()
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
discord_logging-0.1.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for discord_logging-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c8a29a9accaa05dab18376e9e546910a4539e5e848342cb69618ff1972de6325 |
|
MD5 | f3ab545a4b80147213140e48472b75d7 |
|
BLAKE2b-256 | 0f26c85701a10ca0a29329fee2ce3da3dac379985ef741167f95112ad0f4915b |