Replace usage of root logger
authorHarmon <Harmon758@gmail.com>
Wed, 12 Jun 2019 08:06:23 +0000 (03:06 -0500)
committerHarmon <Harmon758@gmail.com>
Wed, 12 Jun 2019 08:06:23 +0000 (03:06 -0500)
tweepy/auth.py
tweepy/streaming.py

index 5838d0c7c07871e42ad9a5ad718d1bcbabb6aed1..80ecbde675c2443a2f04a626299970e182f85538 100644 (file)
@@ -17,6 +17,8 @@ WARNING_MESSAGE = """Warning! Due to a Twitter API bug, signin_with_twitter
 and access_type don't always play nice together. Details
 https://dev.twitter.com/discussions/21281"""
 
+log = logging.getLogger(__name__)
+
 
 class AuthHandler(object):
 
@@ -83,7 +85,7 @@ class OAuthHandler(AuthHandler):
             if signin_with_twitter:
                 url = self._get_oauth_url('authenticate')
                 if access_type:
-                    logging.warning(WARNING_MESSAGE)
+                    log.warning(WARNING_MESSAGE)
             else:
                 url = self._get_oauth_url('authorize')
             self.request_token = self._get_request_token(access_type=access_type)
index 7a487afcc1d3eb3ca9bd67c6637ffd8ba34722ed..32abe63d39913b55668cbae60841fb076e3e2600 100644 (file)
@@ -24,6 +24,8 @@ from tweepy.models import Status
 
 STREAM_VERSION = '1.1'
 
+log = logging.getLogger(__name__)
+
 
 class StreamListener(object):
 
@@ -85,7 +87,7 @@ class StreamListener(object):
             if self.on_user_withheld(data['user_withheld']) is False:
                 return False
         else:
-            logging.error("Unknown message type: %s", raw_data)
+            log.error("Unknown message type: %s", raw_data)
 
     def keep_alive(self):
         """Called when a keep-alive arrived"""