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.
This commit is contained in:
Hornwitser 2015-09-30 20:02:37 +02:00
parent a98324fbf8
commit ea2f35fb24
4 changed files with 16 additions and 0 deletions

View File

@ -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')

View File

@ -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')

View File

@ -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')

View File

@ -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')