Skip to main content

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 discord

import logging
import discord_logging

logger = logging.getLogger()

WEBHOOK_URL = "Your webhook url"
handler = discord_logging.Discord_Handler(WEBHOOK_URL)

logger.addHandler(handler)

client = discord.Client()


@client.event
async def on_ready():
    print('login!(\'\')ゞ')


@client.event
async def on_message(message):

    if message.author.bot:
        return
    if message.content == '/hello':
        await message.channel.send('hello')

client.run('THi5IsDuMMyaCCesSTOK3nQ4.Cl2FMQ.ThIsi5DUMMyAcc3s5ToKen7kKWs')

Project details


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-1.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

discord_logging-1.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page