Tweepy uses the
logging standard library module.
The simplest way to set up logging is using
import logging logging.basicConfig(level=logging.DEBUG)
This will output logging from Tweepy, as well as other libraries (like Tweepy's
dependencies) that use the
logging module, directly to the console.
level argument can be any
To configure logging for Tweepy (or each individual library) specifically, you
logging.getLogger() to retrieve the logger for the library. For
import logging logger = logging.getLogger("tweepy") logger.setLevel(logging.DEBUG) handler = logging.FileHandler(filename="tweepy.log") logger.addHandler(handler)