use loglevel everywhere

This commit is contained in:
fyears
2022-01-05 00:23:49 +08:00
parent 3b195f33c8
commit 8671ba4660
16 changed files with 157 additions and 112 deletions
+5 -2
View File
@@ -5,11 +5,14 @@ import { readAllSyncPlanRecordTexts } from "./localdb";
import type { InternalDBs } from "./localdb";
import { mkdirpInVault } from "./misc";
import * as origLog from "loglevel";
const log = origLog.getLogger("rs-default");
const DEFAULT_DEBUG_FOLDER = "_debug_remotely_save/";
const DEFAULT_SYNC_PLANS_HISTORY_FILE_PREFIX = "sync_plans_hist_exported_on_";
export const exportSyncPlansToFiles = async (db: InternalDBs, vault: Vault) => {
console.log("exporting");
log.info("exporting");
await mkdirpInVault(DEFAULT_DEBUG_FOLDER, vault);
const records = await readAllSyncPlanRecordTexts(db);
let md = "";
@@ -25,5 +28,5 @@ export const exportSyncPlansToFiles = async (db: InternalDBs, vault: Vault) => {
await vault.create(filePath, md, {
mtime: ts,
});
console.log("finish exporting");
log.info("finish exporting");
};