From 66c6dd48a6650469bc2c696c74b4e3f86920e8dd Mon Sep 17 00:00:00 2001
From: Phelokazi Dube <phelokazidube@gmail.com>
Date: Mon, 22 Feb 2021 08:41:19 +0000
Subject: [PATCH] SAR-189 Renamed ska.logging -> ska_ser_logging

Importing the new renamed ska logging libray, ska_ser_logging.
---
 .release                          |  4 ++--
 README.md                         |  3 +++
 docs/source/conf.py               |  4 ++--
 pogo/CspSubElementMaster.xmi      |  2 +-
 pogo/CspSubElementObsDevice.xmi   |  2 +-
 pogo/CspSubElementSubarray.xmi    |  2 +-
 pogo/SKAAlarmHandler.xmi          |  2 +-
 pogo/SKABaseDevice.xmi            |  2 +-
 pogo/SKACapability.xmi            |  2 +-
 pogo/SKALogger.xmi                |  2 +-
 pogo/SKAMaster.xmi                |  2 +-
 pogo/SKAObsDevice.xmi             |  2 +-
 pogo/SKASubarray.xmi              |  2 +-
 pogo/SKATelState.xmi              |  2 +-
 setup.py                          |  2 +-
 src/ska_tango_base/base_device.py | 12 ++++++------
 src/ska_tango_base/release.py     |  2 +-
 tests/test_base_device.py         |  2 +-
 18 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/.release b/.release
index a6c96a3a..65b19ebe 100644
--- a/.release
+++ b/.release
@@ -1,2 +1,2 @@
-release=0.9.0
-tag=ska_tango_base-0.9.0
+release=0.9.1
+tag=ska_tango_base-0.9.1
diff --git a/README.md b/README.md
index 2969f1d7..2c9aa5de 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,9 @@ The ska-tango-base repository includes a set of eight classes as mentioned in SK
 
 ## Version History
 
+#### 0.9.1
+- Changed dependency from `ska_logging` to `ska_ser_logging`.
+
 #### 0.9.0
 - Breaking change: Package rename
   - Installable package name changed from `lmcbaseclasses` to `ska_tango_base`.
diff --git a/docs/source/conf.py b/docs/source/conf.py
index a60425d9..5a69f8f6 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -30,8 +30,8 @@ from unittest.mock import Mock as MagicMock
 import os
 import sys
 autodoc_mock_imports = ['PyTango', 'tango', 'tango.server', 'run', 'command',
-                        'future', 'future.utils', 'transitions', 'ska',
-                        'ska.logging', 'ska.logging.configuration',
+                        'future', 'future.utils', 'transitions',
+                        'ska_ser_logging', 'ska_ser_logging.configuration',
                         'numpy'
                         ]
 
diff --git a/pogo/CspSubElementMaster.xmi b/pogo/CspSubElementMaster.xmi
index d92b0cbe..ce1f3231 100644
--- a/pogo/CspSubElementMaster.xmi
+++ b/pogo/CspSubElementMaster.xmi
@@ -352,7 +352,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/pogo/CspSubElementObsDevice.xmi b/pogo/CspSubElementObsDevice.xmi
index 6c2ed17b..b13e945a 100644
--- a/pogo/CspSubElementObsDevice.xmi
+++ b/pogo/CspSubElementObsDevice.xmi
@@ -249,7 +249,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <attributes name="sdpLinkActive" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="100" maxY="" allocReadMember="true" isDynamic="false">
       <dataType xsi:type="pogoDsl:BooleanType"/>
diff --git a/pogo/CspSubElementSubarray.xmi b/pogo/CspSubElementSubarray.xmi
index 6702ae7f..fae1774e 100644
--- a/pogo/CspSubElementSubarray.xmi
+++ b/pogo/CspSubElementSubarray.xmi
@@ -399,7 +399,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <attributes name="sdpLinkActive" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="100" maxY="" allocReadMember="true" isDynamic="false">
       <dataType xsi:type="pogoDsl:BooleanType"/>
diff --git a/pogo/SKAAlarmHandler.xmi b/pogo/SKAAlarmHandler.xmi
index e8ae4591..5e46b69d 100644
--- a/pogo/SKAAlarmHandler.xmi
+++ b/pogo/SKAAlarmHandler.xmi
@@ -231,7 +231,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/pogo/SKABaseDevice.xmi b/pogo/SKABaseDevice.xmi
index 892b1adb..2678ee59 100644
--- a/pogo/SKABaseDevice.xmi
+++ b/pogo/SKABaseDevice.xmi
@@ -138,7 +138,7 @@
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <dataReadyEvent fire="false" libCheckCriteria="true"/>
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
diff --git a/pogo/SKACapability.xmi b/pogo/SKACapability.xmi
index 30b58884..2a12b45b 100644
--- a/pogo/SKACapability.xmi
+++ b/pogo/SKACapability.xmi
@@ -170,7 +170,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <attributes name="usedComponents" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="100" maxY="" allocReadMember="true" isDynamic="false">
       <dataType xsi:type="pogoDsl:StringType"/>
diff --git a/pogo/SKALogger.xmi b/pogo/SKALogger.xmi
index bad006a3..d61abf2f 100644
--- a/pogo/SKALogger.xmi
+++ b/pogo/SKALogger.xmi
@@ -119,7 +119,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/pogo/SKAMaster.xmi b/pogo/SKAMaster.xmi
index 4c56c65e..2862a87a 100644
--- a/pogo/SKAMaster.xmi
+++ b/pogo/SKAMaster.xmi
@@ -192,7 +192,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/pogo/SKAObsDevice.xmi b/pogo/SKAObsDevice.xmi
index 438d21f3..ca0feba3 100644
--- a/pogo/SKAObsDevice.xmi
+++ b/pogo/SKAObsDevice.xmi
@@ -157,7 +157,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/pogo/SKASubarray.xmi b/pogo/SKASubarray.xmi
index 88fb3f4b..e5a277d6 100644
--- a/pogo/SKASubarray.xmi
+++ b/pogo/SKASubarray.xmi
@@ -255,7 +255,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/pogo/SKATelState.xmi b/pogo/SKATelState.xmi
index 24d9fc0e..39cbae83 100644
--- a/pogo/SKATelState.xmi
+++ b/pogo/SKATelState.xmi
@@ -114,7 +114,7 @@
       <changeEvent fire="false" libCheckCriteria="false"/>
       <archiveEvent fire="false" libCheckCriteria="false"/>
       <status abstract="false" inherited="true" concrete="true"/>
-      <properties description="Logging targets for this device, excluding ska_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
+      <properties description="Logging targets for this device, excluding ska_ser_logging defaults - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
     </attributes>
     <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM.">
       <status abstract="false" inherited="true" concrete="true"/>
diff --git a/setup.py b/setup.py
index 6de91a0b..10ca6a16 100644
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ setuptools.setup(
     ],
     platforms=["OS Independent"],
     setup_requires=[] + pytest_runner,
-    install_requires=["future", "transitions", "ska_logging >= 0.3.0, < 0.4.0"],
+    install_requires=["future", "transitions", "ska_ser_logging"],
     tests_require=["pytest", "coverage", "pytest-json-report", "pytest-forked"],
     entry_points={
         "console_scripts": [
diff --git a/src/ska_tango_base/base_device.py b/src/ska_tango_base/base_device.py
index 39432f3d..6986253c 100644
--- a/src/ska_tango_base/base_device.py
+++ b/src/ska_tango_base/base_device.py
@@ -28,7 +28,7 @@ from tango import AttrWriteType, DebugIt, DevState
 from tango.server import run, Device, attribute, command, device_property
 
 # SKA specific imports
-import ska.logging as ska_logging
+import ska_ser_logging
 from ska_tango_base import release
 from ska_tango_base.commands import (
     ActionCommand, BaseCommand, ResultCode
@@ -286,7 +286,7 @@ class LoggingUtils:
         else:
             raise LoggingTargetError(
                 "Invalid target type requested: '{}' in '{}'".format(target_type, target))
-        formatter = ska_logging.get_default_formatter(tags=True)
+        formatter = ska_ser_logging.get_default_formatter(tags=True)
         handler.setFormatter(formatter)
         handler.name = target
         return handler
@@ -663,7 +663,7 @@ class SKABaseDevice(Device):
         # a flag to ensure the SKA standard logging configuration is only applied once.
         with SKABaseDevice._logging_config_lock:
             if not SKABaseDevice._logging_configured:
-                ska_logging.configure_logging(tags_filter=EnsureTagsFilter)
+                ska_ser_logging.configure_logging(tags_filter=EnsureTagsFilter)
                 SKABaseDevice._logging_configured = True
 
         device_name = self.get_name()
@@ -749,7 +749,7 @@ class SKABaseDevice(Device):
         dtype=('str',),
         access=AttrWriteType.READ_WRITE,
         max_dim_x=4,
-        doc="Logging targets for this device, excluding ska_logging defaults"
+        doc="Logging targets for this device, excluding ska_ser_logging defaults"
             " - initialises to LoggingTargetsDefault on startup",
     )
 
@@ -1010,7 +1010,7 @@ class SKABaseDevice(Device):
         """
         Reads the additional logging targets of the device.
 
-        Note that this excludes the handlers provided by the ska_logging
+        Note that this excludes the handlers provided by the ska_ser_logging
         library defaults.
 
         :return:  Logging level of the device.
@@ -1023,7 +1023,7 @@ class SKABaseDevice(Device):
         """
         Sets the additional logging targets for the device.
 
-        Note that this excludes the handlers provided by the ska_logging
+        Note that this excludes the handlers provided by the ska_ser_logging
         library defaults.
 
         :param value: Logging targets for logger
diff --git a/src/ska_tango_base/release.py b/src/ska_tango_base/release.py
index 19bbf98a..a3970d42 100644
--- a/src/ska_tango_base/release.py
+++ b/src/ska_tango_base/release.py
@@ -7,7 +7,7 @@
 """Release information for ska_tango_base Python Package"""
 
 name = """ska_tango_base"""
-version = "0.9.0"
+version = "0.9.1"
 version_info = version.split(".")
 description = """A set of generic base devices for SKA Telescope."""
 author = "SKA India and SARAO and CSIRO and INAF"
diff --git a/tests/test_base_device.py b/tests/test_base_device.py
index a2601401..896f6e12 100644
--- a/tests/test_base_device.py
+++ b/tests/test_base_device.py
@@ -208,7 +208,7 @@ class TestLoggingUtils:
     @mock.patch('logging.handlers.SysLogHandler')
     @mock.patch('logging.handlers.RotatingFileHandler')
     @mock.patch('logging.StreamHandler')
-    @mock.patch('ska.logging.get_default_formatter')
+    @mock.patch('ska_ser_logging.get_default_formatter')
     def test_create_logging_handler(self,
                                     mock_get_formatter,
                                     mock_stream_handler,
-- 
GitLab