diff options
| author | Hornwitser <[email protected]> | 2015-09-30 20:02:37 +0200 |
|---|---|---|
| committer | Hornwitser <[email protected]> | 2015-10-06 19:09:16 +0200 |
| commit | ea2f35fb2430dd201d38377ef625a2bbc4cb8d7d (patch) | |
| tree | 151f84d5e250a452b3b9307f1c861a53ab618167 | |
| parent | Add handling of login failure in examples (diff) | |
| download | discord.py-ea2f35fb2430dd201d38377ef625a2bbc4cb8d7d.tar.xz discord.py-ea2f35fb2430dd201d38377ef625a2bbc4cb8d7d.zip | |
Set up logging module in examples
Without setting up the logging module, a god number of error conditions
and warnings will never be output by the library. This is a common
pitfall to forget and it's not documented good enough the consequences
of not setting up the logging module when developing applications with
this library.
| -rw-r--r-- | examples/deleted.py | 4 | ||||
| -rw-r--r-- | examples/echo.py | 4 | ||||
| -rw-r--r-- | examples/edits.py | 4 | ||||
| -rw-r--r-- | examples/reply.py | 4 |
4 files changed, 16 insertions, 0 deletions
diff --git a/examples/deleted.py b/examples/deleted.py index 3b6b9897..3bd38ec3 100644 --- a/examples/deleted.py +++ b/examples/deleted.py @@ -1,4 +1,8 @@ import discord +import logging + +# Set up the logging module to output diagnostic to the console. +logging.basicConfig() client = discord.Client() client.login('email', 'password') diff --git a/examples/echo.py b/examples/echo.py index d2b4b20f..21908533 100644 --- a/examples/echo.py +++ b/examples/echo.py @@ -1,4 +1,8 @@ import discord +import logging + +# Set up the logging module to output diagnostic to the console. +logging.basicConfig() client = discord.Client() client.login('email', 'password') diff --git a/examples/edits.py b/examples/edits.py index cb07dc6b..3bf375dc 100644 --- a/examples/edits.py +++ b/examples/edits.py @@ -1,5 +1,9 @@ import discord import time +import logging + +# Set up the logging module to output diagnostic to the console. +logging.basicConfig() client = discord.Client() client.login('email', 'password') diff --git a/examples/reply.py b/examples/reply.py index 0697704d..e23db962 100644 --- a/examples/reply.py +++ b/examples/reply.py @@ -1,4 +1,8 @@ import discord +import logging + +# Set up the logging module to output diagnostic to the console. +logging.basicConfig() client = discord.Client() client.login('email', 'password') |