Skip to content

validation.links.not_found is always reported as INFO #3900

Open
mkdocs-ng/mkdocs
#32

Description

@DetachHead

using mkdocs 1.6.1

project structure

.
└── my-project/
    ├── docs/
    │   ├── asdf.md
    │   └── index.md
    └── mkdocs.yml
<!-- index.md -->
[asdf](./asdf.md)
# mkdocs.yml
site_name: My Docs
validation:
  links:
    not_found: warn
exclude_docs: |
  /asdf.md

mkdocs output

> mkdocs build --strict
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory: C:\Users\user\my-project\site
INFO    -  Doc file 'index.md' contains a link to 'asdf.md' which is excluded from the built site.
INFO    -  Documentation built in 0.14 seconds

Activity

  1. pawamoy commented on Jan 11, 2025

    @pawamoy
    Contributor

    Hi @DetachHead, thanks for the report! I was able to reproduce the issue. Marking as bug, thanks.

  2. pawamoy commented on Jan 11, 2025

    @pawamoy
    Contributor

    Relevant code:

    warning_level = min(logging.INFO, self.config.validation.links.not_found)

    I wonder if there was a specific reason for using min with INFO and configured level. Will check history.

  3. pawamoy commented on Jan 11, 2025

    @pawamoy
    Contributor

    Original issue: #3371. PR: #3449. I note that the issue only complained about INFO logs for links within excluded pages, but the PR also capped the level for links within included pages towards excluded pages. I believe the third-case was simply overlooked.

    • excluded page links to included page: should cap to debug
    • excluded page links to excluded page: should cap to debug
    • included page links to excluded page: should not cap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions