Metadata-Version: 2.1
Name: discordpy-logging-handler
Version: 0.1.0
Summary: Forward Discord bot logs to Discord Text channel.
License: MIT
Author: zztkm
Author-email: takumi.basket1682@gmail.com
Requires-Python: >=3.6.2,<4.0.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: Sphinx[docs] (>=4.3.2,<5.0.0)
Requires-Dist: sphinx-autodoc-typehints[docs] (==1.12.0)
Requires-Dist: sphinx-rtd-theme[docs] (>=1.0.0,<2.0.0)
Description-Content-Type: text/markdown

# WIP: discordpy-logging-handler

Forward Discord bot logs to Discord Text channel.

## Usage

```python
import logging

import discord
from discordpy_logging_handler import DiscordBotHandler


LOG_TEXT_CHANNEL_ID = 1111111111111

logger = logging.getLogger(__name__)


class MyClient(discord.Client):
    async def on_ready(self):
        logger.info("Logged on as {0}!".format(self.user))

    async def on_message(self, message):
        logger.info("Message from {0.author}: {0.content}".format(message))


client = MyClient()
client.run("my token goes here")

log_channel = client.get_channel(LOG_TEXT_CHANNEL_ID)
logger.setLevel(logging.DEBUG)

handler = DiscordBotHandler(log_channel)
handler.setLevel(logging.INFO)

# add ch to logger
logger.addHandler(handler)
```

