mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-02 03:41:08 +00:00
Test the logging facility
This commit is contained in:
+3
-5
@@ -26,15 +26,13 @@ else: #pragma no cover
|
||||
import simplejson as json #pragma no cover
|
||||
|
||||
import GithubException
|
||||
import Logging
|
||||
|
||||
|
||||
class Requester:
|
||||
__httpConnectionClass = httplib.HTTPConnection
|
||||
__httpsConnectionClass = httplib.HTTPSConnection
|
||||
|
||||
@staticmethod
|
||||
def __logger():
|
||||
return logging.getLogger('github')
|
||||
|
||||
@classmethod
|
||||
def injectConnectionClasses( cls, httpConnectionClass, httpsConnectionClass ):
|
||||
cls.__httpConnectionClass = httpConnectionClass
|
||||
@@ -114,7 +112,7 @@ class Requester:
|
||||
if "x-ratelimit-remaining" in headers and "x-ratelimit-limit" in headers:
|
||||
self.rate_limiting = ( int( headers[ "x-ratelimit-remaining" ] ), int( headers[ "x-ratelimit-limit" ] ) )
|
||||
|
||||
logger = self.__logger()
|
||||
logger = Logging.get_logger()
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug(' '.join(map(unicode, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)])))
|
||||
return status, headers, output
|
||||
|
||||
Reference in New Issue
Block a user