Skip to content

Commit

Permalink
Fix log filter issue with mkdocs >= 1.2 (#173)
Browse files Browse the repository at this point in the history
  - issue shown as warnaing since mkdocs 1.5
  • Loading branch information
Laurent Franceschetti committed Aug 3, 2023
1 parent f33011f commit 979a976
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions mkdocs_macros/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
Expand Down

0 comments on commit 979a976

Please sign in to comment.