From: Harmon Date: Wed, 12 Jun 2019 08:06:23 +0000 (-0500) Subject: Replace usage of root logger X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e4d78ef61333c73c206ab2b00449b465ddac7c00;p=tweepy.git Replace usage of root logger --- diff --git a/tweepy/auth.py b/tweepy/auth.py index 5838d0c..80ecbde 100644 --- a/tweepy/auth.py +++ b/tweepy/auth.py @@ -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) diff --git a/tweepy/streaming.py b/tweepy/streaming.py index 7a487af..32abe63 100644 --- a/tweepy/streaming.py +++ b/tweepy/streaming.py @@ -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"""