MkDocs plugin to suppress unwanted log messages using pattern matching.
Project description
Suppress Logs Plugin for MkDocs
MkDocs and its plugins often produce many informational log messages that, while helpful, can clutter your terminal during site builds and make real issues harder to spot.
This plugin allows you to silence specific log messages using customizable wildcard patterns. It's especially useful for suppressing known, non-critical log lines such as:
INFO - Doc file 'some.md' contains an absolute link '/path', it was left as is.
INFO - Doc file 'other.md' contains an unrecognized relative link '../foo', it was left as is.
💡 Use Case
If you're using plugins like mkdocs-webcontext-plugin to rewrite links or your site intentionally contains absolute or unresolved relative links, this plugin can filter those benign warnings.
✅ Features
- Pattern-based filtering of log messages.
- Wildcard support using
{*}for variable sections. - Supports multiple loggers (like
mkdocs.structure.pages, etc.). - Keeps your terminal output clean and focused.
📦 Installation
Install from PyPI:
pip install mkdocs-suppress-logs-plugin
Or with Poetry:
poetry add mkdocs-suppress-logs-plugin
⚙️ Configuration
Add the plugin to your mkdocs.yml:
plugins:
- suppress_logs:
patterns:
- "Doc file '{*}' contains an absolute link '{*}', it was left as is."
- "Doc file '{*}' contains an unrecognized relative link '{*}', it was left as is. Did you mean '{*}'?"
loggers:
- mkdocs.structure.pages
🔧 Pattern Matching
Use {*} as a wildcard in messages you want to suppress.
Example log line:
INFO - Doc file 'guide.md' contains an absolute link '/img.png', it was left as is.
Matching pattern:
Doc file '{*}' contains an absolute link '{*}', it was left as is.
This will suppress any message with that general structure, regardless of the exact file or link.
🧪 Tips
- To find the logger emitting a message, run MkDocs with
--verbose. - You can add multiple patterns and logger names.
- Regex is used under the hood, so avoid overly broad wildcards.
🙏 Thanks
This plugin was inspired by the need for clean terminal outputs during large MkDocs builds and complements:
🗪 License
MIT License – use freely, contribute generously.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_suppress_logs_plugin-0.1.1.tar.gz.
File metadata
- Download URL: mkdocs_suppress_logs_plugin-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff675b1d315eb28ae2b9a4f1ecb848e11b311ee02140f049270f0251276401a1
|
|
| MD5 |
6c3b48dacf258c6f69d0f7e6af772738
|
|
| BLAKE2b-256 |
d3ccefd285870e34c9dcb5c381d29698fda012371213a5b83bd23d8a783f6851
|
File details
Details for the file mkdocs_suppress_logs_plugin-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mkdocs_suppress_logs_plugin-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bb4c286006e6883f40b07cc45dd17043ba29653ada4c27240a60a3aa083f567
|
|
| MD5 |
8c8811b7bcb67f20997f932e652293b8
|
|
| BLAKE2b-256 |
599fea7e907b18a622334e6dbed2ba98ec91b616019f93f9cc4cc5d58797bfb5
|