Use % formatting for log messages over f-strings

This commit is contained in:
Eric Torres 2019-05-03 12:25:55 -07:00
parent 7b27343d52
commit 0c12169130
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ def add(pkgfile, cachedir):
:param cachedir: cache directory to move package to :param cachedir: cache directory to move package to
:type cachedir: path-like object :type cachedir: path-like object
""" """
syslog.info(f"Adding {pkgfile} to {cachedir}") syslog.info("Adding %s to %s", pkgfile, cachedir)
shutil.move(pkgfile, cachedir / pkgfile.name) shutil.move(pkgfile, cachedir / pkgfile.name)
@ -72,7 +72,7 @@ def delete(pkg):
:type pkg: path-like object :type pkg: path-like object
""" """
pkg.unlink() pkg.unlink()
syslog.info(f"Removed {pkg}") syslog.info("Removed %s", pkg)
def _filter_by_regex(regex_expression, iterable): def _filter_by_regex(regex_expression, iterable):

View File

@ -44,8 +44,8 @@ def db_modify(operation, db, *args):
else: else:
raise ValueError(f"Invalid operation specified: {operation}") raise ValueError(f"Invalid operation specified: {operation}")
syslog.debug(f"Database: {db}") syslog.debug("Database: %s", db)
syslog.debug(f"Arguments: {args}") syslog.debug("Arguments: %s", args)
try: try:
process = _run_script(operation, str(db), *args) process = _run_script(operation, str(db), *args)