commit 9644fac37d9451b6a9d9562be7d6306f01f51fa2 Author: Pierre-Yves Chibon pingou@pingoured.fr Date: Wed Mar 5 16:46:03 2014 +0100
Start adding some logging also to the API
pkgdb.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) --- diff --git a/pkgdb.py b/pkgdb.py index 80d5498..f182ee8 100644 --- a/pkgdb.py +++ b/pkgdb.py @@ -16,9 +16,13 @@ """
import json +import logging
import requests
+logging.basicConfig() +LOG = logging.getLogger("pkgdb") +
PKGDB_URL = 'http://209.132.184.188'
@@ -30,6 +34,7 @@ class PkgDBException(Exception): ''' pass
+ def _parse_service_form(response): """ Retrieve the attributes from the html form. """ import bs4 @@ -149,6 +154,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -173,6 +179,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -200,6 +207,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -229,6 +237,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -258,6 +267,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -289,6 +299,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -318,6 +329,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output @@ -353,6 +365,7 @@ class PkgDB(object): output = req.json()
if req.status_code != 200: + LOG.debug('full output %s', outout) raise PkgDBException(output['error'])
return output
packagedb-cli-commits@lists.stg.fedorahosted.org