Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR submittedA PR was submittedannoyanceNot a bug, but should be fixed.metaThis discussion contains some meta aspects.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions