aboutsummaryrefslogtreecommitdiffstats
path: root/onap-client/onap_client/client
diff options
context:
space:
mode:
Diffstat (limited to 'onap-client/onap_client/client')
-rw-r--r--onap-client/onap_client/client/clients.py11
-rw-r--r--onap-client/onap_client/client/request.py7
-rw-r--r--onap-client/onap_client/client/response.py4
3 files changed, 6 insertions, 16 deletions
diff --git a/onap-client/onap_client/client/clients.py b/onap-client/onap_client/client/clients.py
index f0a0c1d..8a8160f 100644
--- a/onap-client/onap_client/client/clients.py
+++ b/onap-client/onap_client/client/clients.py
@@ -36,11 +36,11 @@
# ============LICENSE_END============================================
import importlib
+import logging
import onap_client
import pkgutil
import inspect
import sys
-import logging
from onap_client.client.catalog import Catalog
from onap_client import config
@@ -66,7 +66,7 @@ class Client(Catalog):
super().__init__()
if config_file:
- config.LOG.info("Overriding ONAP Client configuration: {}".format(config_file))
+ logging.info("Overriding ONAP Client configuration: {}".format(config_file))
self.set_config(config_file)
@property
@@ -90,18 +90,13 @@ class Client(Catalog):
def set_config(self, config_file):
self.config = config.load_config(config_file, "onap_client")
- self._set_logging(self.config.LOG_LEVEL)
for attr_name, attr in self.__dict__.items():
if isinstance(attr, Client):
- config.LOG.info("Reloading {} {}".format(attr_name, attr))
+ logging.info("Reloading {} {}".format(attr_name, attr))
attr.set_config(config_file)
for k, v in attr.catalog_resources.items():
attr.load(k, v)
- def _set_logging(self, level):
- LOG = logging.getLogger("ONAP_CLIENT")
- LOG.setLevel(getattr(logging, level.upper()))
-
def import_submodules(package, recursive=True):
"""Import all the modules in onap-client, except for those starting
diff --git a/onap-client/onap_client/client/request.py b/onap-client/onap_client/client/request.py
index 194dad5..268ee98 100644
--- a/onap-client/onap_client/client/request.py
+++ b/onap-client/onap_client/client/request.py
@@ -40,14 +40,12 @@ import requests
import json
import os
import copy
-import logging
+import logging as logger
from onap_client.client.response import ResponseHandler
from onap_client.exceptions import FilesRequestFailure
from jinja2 import exceptions as jinja_exceptions
-logger = logging.getLogger("ONAP_CLIENT")
-
class RequestHandler:
"""Handles a APICatalogRequestObject to make a request
@@ -62,7 +60,7 @@ class RequestHandler:
def make_request(self):
r = Request(self.request_object)
- logger.warning("Submitting request: {}".format(self.request_object.description))
+ logger.info("Submitting request: {}".format(self.request_object.description))
# TODO
# Add verify to config file
return ResponseHandler(r.request(verify=False), self.request_object)
@@ -110,7 +108,6 @@ class Request:
try:
logger.info(json.dumps(debug_request, indent=4))
- # logger.info(debug_request)
except TypeError:
logger.info(debug_request)
diff --git a/onap-client/onap_client/client/response.py b/onap-client/onap_client/client/response.py
index 307ed1b..d9c6a84 100644
--- a/onap-client/onap_client/client/response.py
+++ b/onap-client/onap_client/client/response.py
@@ -36,9 +36,7 @@
# ============LICENSE_END============================================
import simplejson
-import logging
-
-logger = logging.getLogger("ONAP_CLIENT")
+import logging as logger
class ResponseHandler: