Add logger that encapsulates console logging
This commit is contained in:
parent
1f6d13c49d
commit
a987b59b65
12 changed files with 92 additions and 57 deletions
|
@ -1,3 +1,4 @@
|
|||
import logger from "./logger";
|
||||
import { migrate as migrate001 } from "./migrations/001";
|
||||
import { migrate as migrate002 } from "./migrations/002";
|
||||
import { migrate as migrate003 } from "./migrations/003";
|
||||
|
@ -40,7 +41,7 @@ async function migrateFromTo(oldMigrationVersion: number, targetMigrationVersion
|
|||
|
||||
for (const [i, migration] of migrationsToExecute.entries()) {
|
||||
const currentMigrationVersion = oldMigrationVersion + i + 1;
|
||||
console.log("executing migration script ", currentMigrationVersion);
|
||||
logger.info("executing migration script ", currentMigrationVersion);
|
||||
try {
|
||||
await migration();
|
||||
game.settings.set("ds4", "systemMigrationVersion", currentMigrationVersion);
|
||||
|
@ -54,7 +55,7 @@ async function migrateFromTo(oldMigrationVersion: number, targetMigrationVersion
|
|||
{ permanent: true },
|
||||
);
|
||||
err.message = `Failed ds4 system migration: ${err.message}`;
|
||||
console.error(err);
|
||||
logger.error(err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue