Skip to content

Using SuperFences causes useless log output for every single page, even ones without diagrams #121

@goto-dev-null

Description

@goto-dev-null

Prerequisite: have the SuperFences Markdown Extension enabled with a custom fence for mermaid; e.g.:

markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:mermaid2.fence_mermaid_custom

Here is a partial of output of running mkdocs build:

Image

Here is the culprit in the code:

# first, determine if the page has diagrams:
if self.activate_custom_loader:
    # the custom loader has its specific marking
    # <pre class = 'mermaid'><code> ... </code></pre>
    info("Custom loader activated")
    mermaids = len(soup.select("pre.mermaid code"))

I humbly will suggest to remove that log line entirely; I do not see the merit in it at all, even for pages that do have mermaid graphs, because those will output their own INFO:

Image

If it absolutely must remain in, I would plead toward changing it from INFO to DEBUG. I'm not even sure if mkdocs (presently) supports specifying debug as a level, but conceptually to me, if the purpose of a log line is just to say "execution has reached this part in the code", that is a DEBUG or even a TRACE, not an INFO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AnnoyanceNot a bug, but should be fixed.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions