Skip to content

Commit 65c0c7e

Browse files
committed
logger: state: use lazy formatting
1 parent c2dae4b commit 65c0c7e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

dvc/state.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _execute(self, cmd, parameters=()):
141141

142142
def _fetchall(self):
143143
ret = self.cursor.fetchall()
144-
logger.debug("fetched: {}".format(ret))
144+
logger.debug("fetched: {}", ret)
145145
return ret
146146

147147
def _to_sqlite(self, num):
@@ -181,11 +181,12 @@ def _prepare_db(self, empty=False):
181181
__version__, self.VERSION, version
182182
)
183183
elif version < self.VERSION:
184-
msg = (
184+
logger.warning(
185185
"State file version '{}' is too old. "
186-
"Reformatting to the current version '{}'."
186+
"Reformatting to the current version '{}'.",
187+
version,
188+
self.VERSION,
187189
)
188-
logger.warning(msg.format(version, self.VERSION))
189190
cmd = "DROP TABLE IF EXISTS {};"
190191
self._execute(cmd.format(self.STATE_TABLE))
191192
self._execute(cmd.format(self.STATE_INFO_TABLE))
@@ -466,7 +467,7 @@ def remove_unused_links(self, used):
466467
actual_mtime, _ = get_mtime_and_size(path, self.repo.tree)
467468

468469
if inode == actual_inode and mtime == actual_mtime:
469-
logger.debug("Removing '{}' as unused link.".format(path))
470+
logger.debug("Removing '{}' as unused link.", path)
470471
remove(path)
471472
unused.append(relpath)
472473

0 commit comments

Comments
 (0)