log level set to info; with we should be able to have SIMPLE way to set log level
@@ -827,16 +827,12 @@ class PIServerNorthPlugin(object):
if use_compression:
msg_body = gzip.compress(bytes(omf_data_json, 'utf-8'))
msg_header.update({'compression': 'gzip'})
- # CHECK if this is required?
# https://docs.aiohttp.org/en/stable/client_advanced.html#uploading-pre-compressed-data
msg_header.update({'Content-Encoding': 'gzip'})
else:
msg_body = omf_data_json
- # For local server simulation
- # msg_header.update({'content-type': 'application/json'})
-
- self._logger.warning("SEND requested with compression: %s started at: %s", str(use_compression), datetime.datetime.now().isoformat())
+ self._logger.info("SEND requested with compression: %s started at: %s", str(use_compression), datetime.datetime.now().isoformat())
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(verify_ssl=False)) as session:
async with session.post(
url=self._config['URL'],
@@ -847,24 +843,20 @@ class PIServerNorthPlugin(object):
status_code = resp.status
text = await resp.text()
-
except (TimeoutError, asyncio.TimeoutError) as ex:
-
_message = plugin_common.MESSAGES_LIST["e000024"].format(self._config['URL'], "connection Timeout")
_error = plugin_exceptions.URLConnectionError(_message)
except Exception as ex:
-
details = str(ex)
_message = plugin_common.MESSAGES_LIST["e000024"].format(self._config['URL'], details)
_error = plugin_exceptions.URLConnectionError(_message)
else:
- self._logger.warning("PI Server responded with status: %s received at: %s", str(status_code),
+ self._logger.info("PI Server responded with status: %s received at: %s", str(status_code),
datetime.datetime.now().isoformat())
# Evaluate the HTTP status codes
if not str(status_code).startswith('2'):
-
if any(_['id'] == status_code and _['message'] in text for _ in self._config['notBlockingErrors']):
# The error encountered is in the list of not blocking
