mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Closes #27904: Improved logging statements to defer formatting until needed.
This commit is contained in:
parent
ee47e5cf8a
commit
dd917f84e3
15 changed files with 25 additions and 26 deletions
|
@ -85,7 +85,7 @@ class bdist_dumb(Command):
|
|||
install.skip_build = self.skip_build
|
||||
install.warn_dir = 0
|
||||
|
||||
log.info("installing to %s" % self.bdist_dir)
|
||||
log.info("installing to %s", self.bdist_dir)
|
||||
self.run_command('install')
|
||||
|
||||
# And make an archive relative to the root of the
|
||||
|
|
|
@ -363,9 +363,9 @@ class build_ext(Command):
|
|||
|
||||
ext_name, build_info = ext
|
||||
|
||||
log.warn(("old-style (ext_name, build_info) tuple found in "
|
||||
"ext_modules for extension '%s'"
|
||||
"-- please convert to Extension instance" % ext_name))
|
||||
log.warn("old-style (ext_name, build_info) tuple found in "
|
||||
"ext_modules for extension '%s'"
|
||||
"-- please convert to Extension instance", ext_name)
|
||||
|
||||
if not (isinstance(ext_name, str) and
|
||||
extension_name_re.match(ext_name)):
|
||||
|
|
|
@ -337,7 +337,7 @@ def dump_file(filename, head=None):
|
|||
If head is not None, will be dumped before the file content.
|
||||
"""
|
||||
if head is None:
|
||||
log.info('%s' % filename)
|
||||
log.info('%s', filename)
|
||||
else:
|
||||
log.info(head)
|
||||
file = open(filename)
|
||||
|
|
|
@ -385,7 +385,7 @@ class install(Command):
|
|||
else:
|
||||
opt_name = opt_name.translate(longopt_xlate)
|
||||
val = getattr(self, opt_name)
|
||||
log.debug(" %s: %s" % (opt_name, val))
|
||||
log.debug(" %s: %s", opt_name, val)
|
||||
|
||||
def finalize_unix(self):
|
||||
"""Finalizes options for posix platforms."""
|
||||
|
|
|
@ -94,7 +94,7 @@ class register(PyPIRCCommand):
|
|||
'''
|
||||
# send the info to the server and report the result
|
||||
(code, result) = self.post_to_server(self.build_post_data('verify'))
|
||||
log.info('Server response (%s): %s' % (code, result))
|
||||
log.info('Server response (%s): %s', code, result)
|
||||
|
||||
def send_metadata(self):
|
||||
''' Send the metadata to the package index server.
|
||||
|
@ -205,7 +205,7 @@ Your selection [default 1]: ''', log.INFO)
|
|||
data['email'] = input(' EMail: ')
|
||||
code, result = self.post_to_server(data)
|
||||
if code != 200:
|
||||
log.info('Server response (%s): %s' % (code, result))
|
||||
log.info('Server response (%s): %s', code, result)
|
||||
else:
|
||||
log.info('You will receive an email shortly.')
|
||||
log.info(('Follow the instructions in it to '
|
||||
|
@ -216,7 +216,7 @@ Your selection [default 1]: ''', log.INFO)
|
|||
while not data['email']:
|
||||
data['email'] = input('Your email address: ')
|
||||
code, result = self.post_to_server(data)
|
||||
log.info('Server response (%s): %s' % (code, result))
|
||||
log.info('Server response (%s): %s', code, result)
|
||||
|
||||
def build_post_data(self, action):
|
||||
# figure the data to send - the metadata plus some additional
|
||||
|
|
|
@ -412,7 +412,7 @@ class sdist(Command):
|
|||
log.info(msg)
|
||||
for file in files:
|
||||
if not os.path.isfile(file):
|
||||
log.warn("'%s' not a regular file -- skipping" % file)
|
||||
log.warn("'%s' not a regular file -- skipping", file)
|
||||
else:
|
||||
dest = os.path.join(base_dir, file)
|
||||
self.copy_file(file, dest, link=link)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue