diff --git a/mkdocs_macros/util.py b/mkdocs_macros/util.py index 76d0643..ce4837f 100755 --- a/mkdocs_macros/util.py +++ b/mkdocs_macros/util.py @@ -7,8 +7,10 @@ import subprocess from copy import deepcopy import os, sys, importlib.util +from packaging.version import Version from termcolor import colored +import mkdocs # ------------------------------------------ # Trace and debug @@ -17,9 +19,13 @@ TRACE_PREFIX = 'macros' import logging -from mkdocs.utils import warning_filter LOG = logging.getLogger("mkdocs.plugins." + __name__) -LOG.addFilter(warning_filter) + +MKDOCS_LOG_VERSION = '1.2' +if Version(mkdocs.__version__) < Version(MKDOCS_LOG_VERSION): + # filter doesn't do anything since that version + from mkdocs.utils import warning_filter + LOG.addFilter(warning_filter) def format_trace(*args): diff --git a/setup.py b/setup.py index bb664c4..da9fc32 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ # Initialization # -------------------- -VERSION_NUMBER = '1.0.3' +VERSION_NUMBER = '1.0.4' # required if you want to run document/test # pip install 'mkdocs-macros-plugin[test]'