diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2016-10-05 12:28:14 -0400 |
---|---|---|
committer | Kali Kaneko (leap communications) <kali@leap.se> | 2016-10-07 10:22:36 -0400 |
commit | 99b53c1714d302d7f0884e03b5c102081c483504 (patch) | |
tree | 82ac74e776a330338bf94563273aa4d33f578877 /src/leap/bitmask/bonafide/session.py | |
parent | 4a471fb8b434d3df07c5de42fc41590b5d9fc5f5 (diff) |
[refactor] use new logger infrastructure
Diffstat (limited to 'src/leap/bitmask/bonafide/session.py')
-rw-r--r-- | src/leap/bitmask/bonafide/session.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/leap/bitmask/bonafide/session.py b/src/leap/bitmask/bonafide/session.py index 213e773..5a743e9 100644 --- a/src/leap/bitmask/bonafide/session.py +++ b/src/leap/bitmask/bonafide/session.py @@ -18,12 +18,14 @@ LEAP Session management. """ from twisted.internet import defer, reactor -from twisted.python import log +from twisted.logger import Logger from leap.bitmask.bonafide import _srp from leap.bitmask.bonafide import provider from leap.bitmask.bonafide._http import httpRequest, cookieAgentFactory +logger = Logger() + OK = 'ok' @@ -88,7 +90,7 @@ class Session(object): def authenticate(self): uri = self._api.get_handshake_uri() met = self._api.get_handshake_method() - log.msg("%s to %s" % (met, uri)) + logger.debug("%s to %s" % (met, uri)) params = self._srp_auth.get_handshake_params() handshake = yield self._request(self._agent, uri, values=params, @@ -98,7 +100,7 @@ class Session(object): uri = self._api.get_authenticate_uri(login=self.username) met = self._api.get_authenticate_method() - log.msg("%s to %s" % (met, uri)) + logger.debug("%s to %s" % (met, uri)) params = self._srp_auth.get_authentication_params() auth = yield self._request(self._agent, uri, values=params, @@ -215,8 +217,7 @@ if __name__ == "__main__": reactor.stop() def auth_eb(failure): - print "[ERROR!]", failure.getErrorMessage() - log.err(failure) + logger.error(failure) d = session.authenticate() d.addCallback(print_result) |