Skip to content

Commit 0cedf9d

Browse files
committed
refactor: Use %s formatting instead of f-strings in log messages
1 parent a6e3090 commit 0cedf9d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mkdocs_autorefs/plugin.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ def _get_item_url(
105105
else:
106106
if len(urls) > 1:
107107
log.warning(
108-
f"Multiple URLs found for '{identifier}': {urls}. "
108+
"Multiple URLs found for '%s': %s. "
109109
"Make sure to use unique headings, identifiers, or Markdown anchors (see our docs).",
110+
identifier,
111+
urls,
110112
)
111113
return urls[0]
112114

@@ -182,7 +184,7 @@ def on_page_content(self, html: str, page: Page, **kwargs: Any) -> str: # noqa:
182184
The same HTML. We only use this hook to map anchors to URLs.
183185
"""
184186
if self.scan_toc:
185-
log.debug(f"Mapping identifiers to URLs for page {page.file.src_path}")
187+
log.debug("Mapping identifiers to URLs for page %s", page.file.src_path)
186188
for item in page.toc.items:
187189
self.map_urls(page.url, item)
188190
return html
@@ -221,7 +223,7 @@ def on_post_page(self, output: str, page: Page, **kwargs: Any) -> str: # noqa:
221223
Returns:
222224
Modified HTML.
223225
"""
224-
log.debug(f"Fixing references in page {page.file.src_path}")
226+
log.debug("Fixing references in page %s", page.file.src_path)
225227

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

0 commit comments

Comments
 (0)