Skip to content

Commit

Permalink
Improve output of logger
Browse files Browse the repository at this point in the history
Now used logger from mkdocs
  • Loading branch information
timvink committed Sep 14, 2020
1 parent 2260505 commit d2230a5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mkdocs_print_site_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

from mkdocs_print_site_plugin.renderer import Renderer

from mkdocs import utils

logger = logging.getLogger("mkdocs.plugins")
logger.addFilter(utils.warning_filter)

HERE = os.path.dirname(os.path.abspath(__file__))

Expand All @@ -30,7 +34,7 @@ def on_config(self, config, **kwargs):
plugins = config.get("plugins")
print_site_position = [*dict(plugins)].index("print-site")
if print_site_position != len(plugins) - 1:
logging.warning(
logger.warning(
"[mkdocs-print-site] 'print-site' should be defined as the *last* plugin, to ensure the print page has any changes other plugins make. Please update the 'plugins:' section in your mkdocs.yml"
)

Expand All @@ -54,7 +58,7 @@ def on_config(self, config, **kwargs):
if file in os.listdir(os.path.join(HERE, "css")):
config["extra_css"].append("css/%s" % file)
else:
logging.warning(
logger.warning(
"[mkdocs-print-site] Theme '%s' not yet supported, which means print margins and page breaks might be off. Feel free to open an issue!"
% config.get("theme").name
)
Expand Down

0 comments on commit d2230a5

Please sign in to comment.