Skip to content

Commit

Permalink
refactor: Use %s formatting instead of f-strings in log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Aug 31, 2024
1 parent a6e3090 commit 0cedf9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/mkdocs_autorefs/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ def _get_item_url(
else:
if len(urls) > 1:
log.warning(
f"Multiple URLs found for '{identifier}': {urls}. "
"Multiple URLs found for '%s': %s. "
"Make sure to use unique headings, identifiers, or Markdown anchors (see our docs).",
identifier,
urls,
)
return urls[0]

Expand Down Expand Up @@ -182,7 +184,7 @@ def on_page_content(self, html: str, page: Page, **kwargs: Any) -> str: # noqa:
The same HTML. We only use this hook to map anchors to URLs.
"""
if self.scan_toc:
log.debug(f"Mapping identifiers to URLs for page {page.file.src_path}")
log.debug("Mapping identifiers to URLs for page %s", page.file.src_path)
for item in page.toc.items:
self.map_urls(page.url, item)
return html
Expand Down Expand Up @@ -221,7 +223,7 @@ def on_post_page(self, output: str, page: Page, **kwargs: Any) -> str: # noqa:
Returns:
Modified HTML.
"""
log.debug(f"Fixing references in page {page.file.src_path}")
log.debug("Fixing references in page %s", page.file.src_path)

url_mapper = functools.partial(self.get_item_url, from_url=page.url, fallback=self.get_fallback_anchor)
fixed_output, unmapped = fix_refs(output, url_mapper, _legacy_refs=self.legacy_refs)
Expand Down

0 comments on commit 0cedf9d

Please sign in to comment.