diff options
Diffstat (limited to 'obsapi')
| -rw-r--r-- | obsapi/buildapi.py | 1 | ||||
| -rw-r--r-- | obsapi/httpapi.py | 6 | ||||
| -rw-r--r-- | obsapi/logger.py | 30 |
3 files changed, 35 insertions, 2 deletions
diff --git a/obsapi/buildapi.py b/obsapi/buildapi.py index 40054b1..eceea4d 100644 --- a/obsapi/buildapi.py +++ b/obsapi/buildapi.py @@ -2,6 +2,7 @@ # from obsapi.httpapi import ObsHttpApi + class ObsBuildApi(ObsHttpApi): rootapi = '/build/' diff --git a/obsapi/httpapi.py b/obsapi/httpapi.py index 8ca49e8..cfdbfde 100644 --- a/obsapi/httpapi.py +++ b/obsapi/httpapi.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- # import requests +from log import logger from requests.auth import HTTPBasicAuth from null import Null try: import osc.conf as osc_conf -except: +except Exception as e: osc_conf = None DEFAULTAPIURL = 'https://api.opensuse.org' @@ -34,7 +35,8 @@ class ObsHttpApi(object): try: osc_conf.get_config() conf = osc_conf.get_apiurl_api_host_options(self.apiurl) - except: + except Exception as e: + logger.debug(e) pass user = conf.get('user', None) diff --git a/obsapi/logger.py b/obsapi/logger.py new file mode 100644 index 0000000..4831ee0 --- /dev/null +++ b/obsapi/logger.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +""" + obsapi: log module + ~~~~~~~~~~~~~~~~~~~~~~~~ + + This module contains the Logging class + + + :copyright: Copyright (c) 2018 Scott Bahling, SUSE Linux GmbH + :license: GPL-2.0, see COPYING for details +""" + +class Logger(object): + + def __init__(self): + self.logger = None + + def info(msg): + pass + + def warning(msg): + pass + + def debug(msg): + pass + + def error(msg): + pass + +logger = Logger() |
