fix v1 log appearing next to export

This commit is contained in:
Damien Elmes 2020-05-05 16:15:49 +10:00
parent 08f894735a
commit e37774f0bd
2 changed files with 5 additions and 3 deletions

View file

@ -63,9 +63,10 @@ class _Collection:
db: DBProxy,
backend: RustBackend,
server: Optional["anki.storage.ServerData"] = None,
log: bool = False,
) -> None:
self.backend = backend
self._debugLog = not server
self._debugLog = log
self.db = db
self.path = db._path
self._openLog()

View file

@ -41,7 +41,8 @@ def Collection(
(media_dir, media_db) = media_paths_from_col_path(path)
log_path = ""
if not server and log:
should_log = not server and log
if should_log:
log_path = path.replace(".anki2", "2.log")
path = os.path.abspath(path)
@ -55,7 +56,7 @@ def Collection(
initial_db_setup(db)
# add db to col and do any remaining upgrades
col = _Collection(db, backend=backend, server=server)
col = _Collection(db, backend=backend, server=server, log=should_log)
if create:
# add in reverse order so basic is default
addClozeModel(col)