From 5cdc91baca81a39fcf979d996948779a1ff98e1e Mon Sep 17 00:00:00 2001 From: liangke Date: Tue, 12 Feb 2019 10:32:58 +0800 Subject: upgrade pylog version upgrade latest version of pylog to 1.0.7 fix pep8 error use relative imports Change-Id: I705756b0778f89fbce62559ea0f108fd35efff5e Issue-ID: MULTICLOUD-481 Signed-off-by: liangke --- pylog/onaplogging/colorFormatter.py | 2 -- pylog/onaplogging/marker/__init__.py | 8 ++++---- pylog/onaplogging/marker/markerFactory.py | 2 +- pylog/onaplogging/marker/markerFilter.py | 2 +- pylog/onaplogging/marker/markerHandler.py | 2 +- pylog/onaplogging/markerFormatter.py | 10 +++++----- pylog/onaplogging/markerLogAdaptor.py | 6 +++--- pylog/onaplogging/mdcContext.py | 2 +- pylog/onaplogging/mdcformatter.py | 2 +- pylog/onaplogging/monkey.py | 4 ++-- pylog/setup.py | 6 ++++-- 11 files changed, 23 insertions(+), 23 deletions(-) diff --git a/pylog/onaplogging/colorFormatter.py b/pylog/onaplogging/colorFormatter.py index a60e441..64e220a 100644 --- a/pylog/onaplogging/colorFormatter.py +++ b/pylog/onaplogging/colorFormatter.py @@ -105,8 +105,6 @@ class BaseColorFormatter(Formatter): self.colorfmt = colorfmt - print(self.colorfmt, isinstance(self.colorfmt, dict)) - def _parseColor(self, record): """ color formatter for instance: diff --git a/pylog/onaplogging/marker/__init__.py b/pylog/onaplogging/marker/__init__.py index a1b3d89..e6ef67b 100644 --- a/pylog/onaplogging/marker/__init__.py +++ b/pylog/onaplogging/marker/__init__.py @@ -14,13 +14,13 @@ from __future__ import absolute_import -from marker.marker import ( +from .marker import ( Marker, MARKER_TAG, BaseMarker, matchMarkerHelp) -from marker.markerFactory import MarkerFactory -from marker.markerHandler import MarkerNotifyHandler -from marker.markerFilter import MarkerFilter +from .markerFactory import MarkerFactory +from .markerHandler import MarkerNotifyHandler +from .markerFilter import MarkerFilter __all__ = ("Marker", "MARKER_TAG", "BaseMarker", "matchMarkerHelp", "MarkerFactory", diff --git a/pylog/onaplogging/marker/markerFactory.py b/pylog/onaplogging/marker/markerFactory.py index e7b00b9..0705235 100644 --- a/pylog/onaplogging/marker/markerFactory.py +++ b/pylog/onaplogging/marker/markerFactory.py @@ -14,7 +14,7 @@ import abc import threading -from marker import BaseMarker +from .marker import BaseMarker lock = threading.RLock() diff --git a/pylog/onaplogging/marker/markerFilter.py b/pylog/onaplogging/marker/markerFilter.py index 4ae5478..4f49884 100644 --- a/pylog/onaplogging/marker/markerFilter.py +++ b/pylog/onaplogging/marker/markerFilter.py @@ -14,7 +14,7 @@ import sys from logging import Filter -from marker import matchMarkerHelp +from .marker import matchMarkerHelp class MarkerFilter(Filter): diff --git a/pylog/onaplogging/marker/markerHandler.py b/pylog/onaplogging/marker/markerHandler.py index ca5f483..12b5488 100644 --- a/pylog/onaplogging/marker/markerHandler.py +++ b/pylog/onaplogging/marker/markerHandler.py @@ -14,7 +14,7 @@ import sys from logging.handlers import SMTPHandler -from marker import matchMarkerHelp +from .marker import matchMarkerHelp class MarkerNotifyHandler(SMTPHandler): diff --git a/pylog/onaplogging/markerFormatter.py b/pylog/onaplogging/markerFormatter.py index c9b0628..a322e29 100644 --- a/pylog/onaplogging/markerFormatter.py +++ b/pylog/onaplogging/markerFormatter.py @@ -14,9 +14,9 @@ import sys import logging -from marker import MARKER_TAG -from marker import Marker -from colorFormatter import BaseColorFormatter +from .marker import MARKER_TAG +from .marker import Marker +from .colorFormatter import BaseColorFormatter class MarkerFormatter(BaseColorFormatter): @@ -54,7 +54,7 @@ class MarkerFormatter(BaseColorFormatter): elif self._fmt.find(self._marker_tag) != -1 \ and not hasattr(record, MARKER_TAG): - self._fmt = self._fmt.replace(self._marker_tag, "") + self._fmt = self._fmt.replace(self._marker_tag, "") if sys.version_info > (3, 2): self._style = logging._STYLES[self.style][0](self._fmt) @@ -65,4 +65,4 @@ class MarkerFormatter(BaseColorFormatter): return BaseColorFormatter.format(self, record) finally: - self._fmt = self._tmpFmt + self._fmt = self._tmpFmt diff --git a/pylog/onaplogging/markerLogAdaptor.py b/pylog/onaplogging/markerLogAdaptor.py index d787f2b..e901758 100644 --- a/pylog/onaplogging/markerLogAdaptor.py +++ b/pylog/onaplogging/markerLogAdaptor.py @@ -16,9 +16,9 @@ import sys from logging import LoggerAdapter from threading import RLock from functools import wraps -from marker import MARKER_TAG -from marker import Marker -from mdcContext import _getmdcs +from .marker import MARKER_TAG +from .marker import Marker +from .mdcContext import _getmdcs lock = RLock() diff --git a/pylog/onaplogging/mdcContext.py b/pylog/onaplogging/mdcContext.py index 4fdc99c..cecf8fe 100644 --- a/pylog/onaplogging/mdcContext.py +++ b/pylog/onaplogging/mdcContext.py @@ -91,7 +91,7 @@ def _getmdcs(extra=None): for key in extra: # make sure extra key dosen't override mdckey if key in mdc or key == 'mdc': - raise KeyError("Attempt to overwrite %r in MDC" % key) + raise KeyError("Attempt to overwrite %r in MDC" % key) else: extra = {} diff --git a/pylog/onaplogging/mdcformatter.py b/pylog/onaplogging/mdcformatter.py index 74ff894..545a4c1 100644 --- a/pylog/onaplogging/mdcformatter.py +++ b/pylog/onaplogging/mdcformatter.py @@ -14,7 +14,7 @@ import sys import logging -from markerFormatter import MarkerFormatter +from .markerFormatter import MarkerFormatter class MDCFormatter(MarkerFormatter): diff --git a/pylog/onaplogging/monkey.py b/pylog/onaplogging/monkey.py index 00659c7..f8bf992 100644 --- a/pylog/onaplogging/monkey.py +++ b/pylog/onaplogging/monkey.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from mdcContext import patch_loggingMDC -from logWatchDog import patch_loggingYaml +from .mdcContext import patch_loggingMDC +from .logWatchDog import patch_loggingYaml __all__ = ["patch_all"] diff --git a/pylog/setup.py b/pylog/setup.py index 6a3bd1a..99669fd 100644 --- a/pylog/setup.py +++ b/pylog/setup.py @@ -21,12 +21,13 @@ setup( long_description="python-package onappylog could be used in any python" "project to record MDC information and reload logging" "at runtime", - version="1.0.5", + version="1.0.7", license="Apache 2.0", author='ke liang', author_email="lokyse@163.com", packages=find_packages(), platforms=['all'], + url="https://github.com/onap/logging-analytics/tree/master/pylog", install_requires=[ "PyYAML>=3.10", "watchdog>=0.8.3" @@ -34,6 +35,7 @@ setup( classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', - 'Programming Language :: Python :: 2.7' + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3' ] ) -- cgit 1.2.3-korg