Skip to content

Commit

Permalink
MAINT: Don't format logs in log call. (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Jan 24, 2023
1 parent 9bd9246 commit 269449f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion jupyter_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def load_config_file(self, suppress_errors=True):
# self.raise_config_file_errors
if (not suppress_errors) or self.raise_config_file_errors:
raise
self.log.warning("Error loading config file: %s" % config_file_name, exc_info=True)
self.log.warning("Error loading config file: %s", config_file_name, exc_info=True)

# subcommand-related
def _find_subcommand(self, name):
Expand Down
18 changes: 9 additions & 9 deletions jupyter_core/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ def migrate_dir(src, dst):
"""Migrate a directory from src to dst"""
log = get_logger()
if not os.listdir(src):
log.debug("No files in %s" % src)
log.debug("No files in %s", src)
return False
if os.path.exists(dst):
if os.listdir(dst):
# already exists, non-empty
log.debug("%s already exists" % dst)
log.debug("%s already exists", dst)
return False
else:
os.rmdir(dst)
log.info(f"Copying {src} -> {dst}")
log.info("Copying %s -> %s", src, dst)
ensure_dir_exists(os.path.dirname(dst))
shutil.copytree(src, dst, symlinks=True)
return True
Expand All @@ -105,9 +105,9 @@ def migrate_file(src, dst, substitutions=None):
log = get_logger()
if os.path.exists(dst):
# already exists
log.debug("%s already exists" % dst)
log.debug("%s already exists", dst)
return False
log.info(f"Copying {src} -> {dst}")
log.info("Copying %s -> %s", src, dst)
ensure_dir_exists(os.path.dirname(dst))
shutil.copy(src, dst)
if substitutions:
Expand All @@ -131,7 +131,7 @@ def migrate_one(src, dst):
elif os.path.isdir(src):
return migrate_dir(src, dst)
else:
log.debug("Nothing to migrate for %s" % src)
log.debug("Nothing to migrate for %s", src)
return False


Expand Down Expand Up @@ -163,9 +163,9 @@ def migrate_static_custom(src, dst):
custom_css_empty = css.startswith("/*") and css.endswith("*/")

if custom_js_empty:
log.debug("Ignoring empty %s" % custom_js)
log.debug("Ignoring empty %s", custom_js)
if custom_css_empty:
log.debug("Ignoring empty %s" % custom_css)
log.debug("Ignoring empty %s", custom_css)

if custom_js_empty and custom_css_empty:
# nothing to migrate
Expand Down Expand Up @@ -208,7 +208,7 @@ def migrate_config(name, env):
migrated.append(src)
else:
# don't migrate empty config files
log.debug("Not migrating empty config file: %s" % src)
log.debug("Not migrating empty config file: %s", src)
return migrated


Expand Down

0 comments on commit 269449f

Please sign in to comment.