diff options
author | 2020-07-13 12:58:12 +0000 | |
---|---|---|
committer | 2020-07-13 12:58:12 +0000 | |
commit | e713a6ee28b4c7348eb17d2f228e0b89b8b9db5f (patch) | |
tree | f89dbbfcacbe1b5ccda88ef2c59550be8e7805e9 /pylog/onaplogging/mdcformatter.py | |
parent | c1884ba03fc92d9e680e09a303edf975286e63ac (diff) | |
parent | b437b2c38ec0d5bb234fef0459b0e0533d08b7af (diff) |
Merge "Pylog test suite"
Diffstat (limited to 'pylog/onaplogging/mdcformatter.py')
-rw-r--r-- | pylog/onaplogging/mdcformatter.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pylog/onaplogging/mdcformatter.py b/pylog/onaplogging/mdcformatter.py index 545a4c1..4cacbe8 100644 --- a/pylog/onaplogging/mdcformatter.py +++ b/pylog/onaplogging/mdcformatter.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import logging from .markerFormatter import MarkerFormatter +from .utils import is_above_python_2_7, is_above_python_3_2 class MDCFormatter(MarkerFormatter): @@ -33,12 +33,12 @@ class MDCFormatter(MarkerFormatter): :param colorfmt: colored output with ANSI escape code on terminal :param style: style mapping keys in python3 """ - if sys.version_info > (3, 2): + if is_above_python_3_2(): super(MDCFormatter, self).__init__(fmt=fmt, datefmt=datefmt, colorfmt=colorfmt, style=style) - elif sys.version_info > (2, 7): + elif is_above_python_2_7(): super(MDCFormatter, self).__init__(fmt=fmt, datefmt=datefmt, colorfmt=colorfmt) @@ -112,7 +112,7 @@ class MDCFormatter(MarkerFormatter): """ mdcIndex = self._fmt.find(self._mdc_tag) if mdcIndex == -1: - if sys.version_info > (2, 7): + if is_above_python_2_7(): return super(MDCFormatter, self).format(record) else: return MarkerFormatter.format(self, record) @@ -121,10 +121,10 @@ class MDCFormatter(MarkerFormatter): if mdcFmtWords is None: self._fmt = self._fmt.replace(self._mdc_tag, "") - if sys.version_info > (3, 2): + if is_above_python_3_2(): self._style = logging._STYLES[self.style][0](self._fmt) - if sys.version_info > (2, 7): + if is_above_python_2_7(): return super(MDCFormatter, self).format(record) else: return MarkerFormatter.format(self, record) @@ -142,10 +142,10 @@ class MDCFormatter(MarkerFormatter): mdcstr = self._replaceStr(keys=mdcFmtkeys).format(**res) self._fmt = self._fmt.replace(self._mdc_tag, mdcstr) - if sys.version_info > (3, 2): + if is_above_python_3_2(): self._style = logging._STYLES[self.style][0](self._fmt) - if sys.version_info > (2, 7): + if is_above_python_2_7(): return super(MDCFormatter, self).format(record) else: return MarkerFormatter.format(self, record) |