Skip to content

Projects plugin: distinguish between sub-projects in logging #6414

@alexvoss

Description

@alexvoss

Context

When building a project with subprojects through the Projects plugin, the log entries generated by the concurrent build processes for the subprojects are interleaved and it can be difficult to tell which subproject generated which message.

Description

The log entries for the subprojects should be tagged with the name of the subproject so the user can tell which subproject generated which message. They will still be interleaved, as shown below, but it will be possible to filter them with an appropriate log filtering tool.

INFO    -  Building documentation to directory:
           /home/avoss/src/mkdocs-material/examples/examples/color-palette-toggle/site
INFO    -  Building documentation to directory:
           /home/avoss/src/mkdocs-material/examples/examples/custom-colors/site
INFO    -  Cleaning site directory
INFO    -  Building documentation to directory:
           /home/avoss/src/mkdocs-material/examples/examples/blog-rss/site
INFO    -  Doc file 'README.md' contains an unrecognized relative link
           '../fonts-custom', it was left as is.
INFO    -  Doc file 'README.md' contains an unrecognized relative link
           'blog/2023/10/11/my-first-blog-post', it was left as is.
INFO    -  Doc file 'README.md' contains an unrecognized relative link 'blog',
           it was left as is. Did you mean 'blog/index.md'?
INFO    -  Doc file 'README.md' contains an unrecognized relative link
           'blog/archive/2023', it was left as is. Did you mean
           'blog/archive/2023.md'?
INFO    -  Doc file 'README.md' contains an unrecognized relative link
           'blog/category/meta', it was left as is. Did you mean
           'blog/category/meta.md'?
INFO    -  Doc file 'README.md' contains an unrecognized relative link
           '../blog-basic', it was left as is.
INFO    -  Building documentation to directory:
           /home/avoss/src/mkdocs-material/examples/examples/fonts-custom/site
INFO    -  Documentation built in 0.40 seconds
INFO    -  Documentation built in 0.40 seconds
INFO    -  Documentation built in 0.37 seconds
INFO    -  Documentation built in 0.38 seconds
INFO    -  Documentation built in 0.41 seconds
INFO    -  Documentation built in 0.41 seconds

Note that the README file for blog-rss contains none of the links that MkDocs complains about here. Also, the summary of how much time each project took to build is ambiguous.

This will require some modification of the subproject settings, I assume, to instruct MkDocs to not just log to the console or to include the tag. I included a link below to some info on how to log in parallel processes. This should require a change both in the projects plugin and in MkDocs, I guess.

Related links

Use Cases

There are a couple of use cases that come to my mind:

  • figuring out which subprojects errors and warnings belong to
  • figuring out which subprojects take a long time to build

Visuals

No response

Before submitting

Metadata

Metadata

Assignees

No one assigned

    Labels

    change requestIssue requests a new feature or improvementresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions