Add utils.setup_logging to help set up logging outside of Client.run

This commit is contained in:
Rapptz
2022-08-17 22:13:01 -04:00
parent 1c7747fe9d
commit 2bf2bfc9b4
5 changed files with 139 additions and 89 deletions

View File

@ -75,6 +75,9 @@ async def main():
handler.setFormatter(formatter)
logger.addHandler(handler)
# Alternatively, you could use:
# discord.utils.setup_logging(handler=handler, root=False)
# One of the reasons to take over more of the process though
# is to ensure use with other libraries or tools which also require their own cleanup.