mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Pass format arguments to logger
This commit is contained in:
parent
e58dd58f35
commit
c973de391e
@ -259,8 +259,14 @@ class CObject(ObjectDescription[ASTDeclaration]):
|
||||
self.env.temp_data['c:last_symbol'] = e.symbol
|
||||
msg = __("Duplicate C declaration, also defined at %s:%s.\n"
|
||||
"Declaration is '.. c:%s:: %s'.")
|
||||
msg = msg % (e.symbol.docname, e.symbol.line, self.display_object_type, sig)
|
||||
logger.warning(msg, location=signode)
|
||||
logger.warning(
|
||||
msg,
|
||||
e.symbol.docname,
|
||||
e.symbol.line,
|
||||
self.display_object_type,
|
||||
sig,
|
||||
location=signode,
|
||||
)
|
||||
|
||||
if ast.objectType == 'enumerator':
|
||||
self._add_enumerator_to_parent(ast)
|
||||
|
@ -508,9 +508,14 @@ class Symbol:
|
||||
name = str(ourChild.declaration)
|
||||
msg = __("Duplicate C declaration, also defined at %s:%s.\n"
|
||||
"Declaration is '.. c:%s:: %s'.")
|
||||
msg = msg % (ourChild.docname, ourChild.line,
|
||||
ourChild.declaration.directiveType, name)
|
||||
logger.warning(msg, location=(otherChild.docname, otherChild.line))
|
||||
logger.warning(
|
||||
msg,
|
||||
ourChild.docname,
|
||||
ourChild.line,
|
||||
ourChild.declaration.directiveType,
|
||||
name,
|
||||
location=(otherChild.docname, otherChild.line),
|
||||
)
|
||||
else:
|
||||
# Both have declarations, and in the same docname.
|
||||
# This can apparently happen, it should be safe to
|
||||
|
@ -359,9 +359,14 @@ class CPPObject(ObjectDescription[ASTDeclaration]):
|
||||
self.env.temp_data['cpp:last_symbol'] = e.symbol
|
||||
msg = __("Duplicate C++ declaration, also defined at %s:%s.\n"
|
||||
"Declaration is '.. cpp:%s:: %s'.")
|
||||
msg = msg % (e.symbol.docname, e.symbol.line,
|
||||
self.display_object_type, sig)
|
||||
logger.warning(msg, location=signode)
|
||||
logger.warning(
|
||||
msg,
|
||||
e.symbol.docname,
|
||||
e.symbol.line,
|
||||
self.display_object_type,
|
||||
sig,
|
||||
location=signode,
|
||||
)
|
||||
|
||||
if ast.objectType == 'enumerator':
|
||||
self._add_enumerator_to_parent(ast)
|
||||
|
@ -792,9 +792,14 @@ class Symbol:
|
||||
name = str(ourChild.declaration)
|
||||
msg = __("Duplicate C++ declaration, also defined at %s:%s.\n"
|
||||
"Declaration is '.. cpp:%s:: %s'.")
|
||||
msg = msg % (ourChild.docname, ourChild.line,
|
||||
ourChild.declaration.directiveType, name)
|
||||
logger.warning(msg, location=(otherChild.docname, otherChild.line))
|
||||
logger.warning(
|
||||
msg,
|
||||
ourChild.docname,
|
||||
ourChild.line,
|
||||
ourChild.declaration.directiveType,
|
||||
name,
|
||||
location=(otherChild.docname, otherChild.line),
|
||||
)
|
||||
else:
|
||||
if (otherChild.declaration.objectType ==
|
||||
ourChild.declaration.objectType and
|
||||
|
Loading…
Reference in New Issue
Block a user