Route application diagnostics through owned log paths

This commit is contained in:
vorotamoroz
2026-07-18 16:53:20 +00:00
parent 3e22c2eda8
commit 81d27a932f
22 changed files with 154 additions and 105 deletions
+6 -5
View File
@@ -74,12 +74,13 @@ export class ModuleDev extends AbstractObsidianModule {
if (w) {
const id = await this.services.path.path2id(filename as FilePathWithPrefix);
const f = await this.core.localDatabase.getRaw(id);
console.log(f);
console.log(f._rev);
this._log(f, LOG_LEVEL_VERBOSE);
this._log(f._rev, LOG_LEVEL_VERBOSE);
const revConflict = f._rev.split("-")[0] + "-" + (parseInt(f._rev.split("-")[1]) + 1).toString();
console.log(await this.core.localDatabase.bulkDocsRaw([f], { new_edits: false }));
console.log(
await this.core.localDatabase.bulkDocsRaw([{ ...f, _rev: revConflict }], { new_edits: false })
this._log(await this.core.localDatabase.bulkDocsRaw([f], { new_edits: false }), LOG_LEVEL_VERBOSE);
this._log(
await this.core.localDatabase.bulkDocsRaw([{ ...f, _rev: revConflict }], { new_edits: false }),
LOG_LEVEL_VERBOSE
);
}
},
@@ -657,7 +657,6 @@ export class DocumentHistoryModal extends Modal {
const { contentEl } = this;
contentEl.empty();
this.BlobURLs.forEach((value) => {
console.log(value);
if (value) URL.revokeObjectURL(value);
});
}
-7
View File
@@ -551,13 +551,6 @@ ${stringifyYaml(info)}
return;
}
addDisplayLog(newMessage);
if (message instanceof Error) {
console.error(vaultName + ":" + newMessage);
} else if (level >= LOG_LEVEL_INFO) {
console.log(vaultName + ":" + newMessage);
} else {
console.debug(vaultName + ":" + newMessage);
}
if (!this.settings?.showOnlyIconsOnEditor) {
this.statusLog.value = messageContent;
}
@@ -121,8 +121,7 @@ export async function migrateDatabases(operationName: string, from: PouchDB.Data
Logger(`Destroyed existing destination database for migration: ${operationName}.`, LOG_LEVEL_NOTICE, "migration");
const dbTo2 = await openTo();
const info2 = await dbTo2.info(); // ensure created
console.log(info2);
await dbTo2.info(); // ensure created
Logger(`Re-created destination database for migration: ${operationName}.`, LOG_LEVEL_NOTICE, "migration");
const info = await from.info();
@@ -6,6 +6,7 @@
import Decision from "@/modules/services/LiveSyncUI/components/Decision.svelte";
import UserDecisions from "@/modules/services/LiveSyncUI/components/UserDecisions.svelte";
import { checkConfig, type ConfigCheckResult, type ResultError, type ResultErrorMessage } from "./utilCheckCouchDB";
import { LOG_LEVEL_VERBOSE, Logger } from "octagonal-wheels/common/logger";
type Props = {
trialRemoteSetting: ObsidianLiveSyncSettings;
};
@@ -15,10 +16,9 @@
detectedIssues = [];
try {
const fixResults = await checkConfig(trialRemoteSetting);
console.dir(fixResults);
detectedIssues = fixResults;
} catch (e) {
console.error("Error during testAndFixSettings:", e);
Logger(e, LOG_LEVEL_VERBOSE, "setup-couchdb-check");
detectedIssues.push({ message: `Error during testAndFixSettings: ${e}`, result: "error", classes: [] });
}
}
@@ -37,7 +37,7 @@
processing = true;
await issue.fix();
} catch (e) {
console.error("Error during fixIssue:", e);
Logger(e, LOG_LEVEL_VERBOSE, "setup-couchdb-fix");
}
await testAndFixSettings();
processing = false;
@@ -27,6 +27,7 @@
import { SETTING_KEY_P2P_DEVICE_NAME } from "@vrtmrz/livesync-commonlib/compat/common/types";
import ExtraItems from "@/modules/services/LiveSyncUI/components/ExtraItems.svelte";
import { TYPE_CANCELLED, type SetupRemoteP2PResultType } from "./setupDialogTypes";
import { LOG_LEVEL_VERBOSE, Logger } from "octagonal-wheels/common/logger";
const default_setting = pickP2PSyncSettings(DEFAULT_SETTINGS);
let syncSetting = $state<P2PConnectionInfo>({ ...default_setting });
@@ -137,7 +138,7 @@
replicator.close();
dummyPouch.destroy();
} catch (e) {
console.error(e);
Logger(e, LOG_LEVEL_VERBOSE, "setup-p2p-cleanup");
}
}
} finally {