diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2016-08-31 07:22:29 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2016-08-31 07:22:29 (GMT) |
commit | dd917f84e3775596049e09746f32053c50b3d422 (patch) | |
tree | 5b59a563c228493069bcf00e166fba7cea8ebfef /Lib | |
parent | ee47e5cf8ad0e52e2c5291662b9b15c2ba8848ea (diff) | |
download | cpython-dd917f84e3775596049e09746f32053c50b3d422.zip cpython-dd917f84e3775596049e09746f32053c50b3d422.tar.gz cpython-dd917f84e3775596049e09746f32053c50b3d422.tar.bz2 |
Closes #27904: Improved logging statements to defer formatting until needed.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncio/base_events.py | 4 | ||||
-rw-r--r-- | Lib/distutils/archive_util.py | 2 | ||||
-rw-r--r-- | Lib/distutils/cmd.py | 3 | ||||
-rw-r--r-- | Lib/distutils/command/bdist_dumb.py | 2 | ||||
-rw-r--r-- | Lib/distutils/command/build_ext.py | 6 | ||||
-rw-r--r-- | Lib/distutils/command/config.py | 2 | ||||
-rw-r--r-- | Lib/distutils/command/install.py | 2 | ||||
-rw-r--r-- | Lib/distutils/command/register.py | 6 | ||||
-rw-r--r-- | Lib/distutils/command/sdist.py | 2 |
9 files changed, 14 insertions, 15 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 0916da8..918b869 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -1069,7 +1069,7 @@ class BaseEventLoop(events.AbstractEventLoop): transport = yield from self._make_subprocess_transport( protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs) if self._debug: - logger.info('%s: %r' % (debug_log, transport)) + logger.info('%s: %r', debug_log, transport) return transport, protocol @coroutine @@ -1099,7 +1099,7 @@ class BaseEventLoop(events.AbstractEventLoop): protocol, popen_args, False, stdin, stdout, stderr, bufsize, **kwargs) if self._debug: - logger.info('%s: %r' % (debug_log, transport)) + logger.info('%s: %r', debug_log, transport) return transport, protocol def get_exception_handler(self): diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py index bed1384..78ae575 100644 --- a/Lib/distutils/archive_util.py +++ b/Lib/distutils/archive_util.py @@ -171,7 +171,7 @@ def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): zip.write(path, path) - log.info("adding '%s'" % path) + log.info("adding '%s'", path) zip.close() return zip_filename diff --git a/Lib/distutils/cmd.py b/Lib/distutils/cmd.py index c89d5ef..b5d9dc3 100644 --- a/Lib/distutils/cmd.py +++ b/Lib/distutils/cmd.py @@ -329,8 +329,7 @@ class Command: # -- External world manipulation ----------------------------------- def warn(self, msg): - log.warn("warning: %s: %s\n" % - (self.get_command_name(), msg)) + log.warn("warning: %s: %s\n", self.get_command_name(), msg) def execute(self, func, args, msg=None, level=1): util.execute(func, args, msg, dry_run=self.dry_run) diff --git a/Lib/distutils/command/bdist_dumb.py b/Lib/distutils/command/bdist_dumb.py index f1bfb24..e9274d9 100644 --- a/Lib/distutils/command/bdist_dumb.py +++ b/Lib/distutils/command/bdist_dumb.py @@ -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 diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index f03a4e3..5e51ae4 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -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)): diff --git a/Lib/distutils/command/config.py b/Lib/distutils/command/config.py index b1fd09e..4ae153d 100644 --- a/Lib/distutils/command/config.py +++ b/Lib/distutils/command/config.py @@ -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) diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 9474e9c..fca05d6 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -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.""" diff --git a/Lib/distutils/command/register.py b/Lib/distutils/command/register.py index 456d50d..0fac94e 100644 --- a/Lib/distutils/command/register.py +++ b/Lib/distutils/command/register.py @@ -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 diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py index f1b8d91..4fd1d47 100644 --- a/Lib/distutils/command/sdist.py +++ b/Lib/distutils/command/sdist.py @@ -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) |