Prefixed console.logs

This commit is contained in:
Simon Cambier
2022-09-20 12:52:41 +02:00
parent d09dd23bc8
commit 31aab49c54
2 changed files with 5 additions and 5 deletions

View File

@@ -32,9 +32,9 @@ export async function loadNotesCache(): Promise<void> {
try { try {
const json = await app.vault.adapter.read(notesCacheFilePath) const json = await app.vault.adapter.read(notesCacheFilePath)
notesCache = JSON.parse(json) notesCache = JSON.parse(json)
console.log('Notes cache loaded from the file') console.log('Omnisearch - Notes cache loaded from the file')
} catch (e) { } catch (e) {
console.trace('Could not load Notes cache from the file') console.trace('Omnisearch - Could not load Notes cache from the file')
console.error(e) console.error(e)
} }
} }
@@ -154,7 +154,7 @@ export function removeAnchors(name: string): string {
export async function saveNotesCacheToFile(): Promise<void> { export async function saveNotesCacheToFile(): Promise<void> {
const json = JSON.stringify(notesCache) const json = JSON.stringify(notesCache)
await app.vault.adapter.write(notesCacheFilePath, json) await app.vault.adapter.write(notesCacheFilePath, json)
console.log('Notes cache saved to the file') console.log('Omnisearch - Notes cache saved to the file')
} }
export function isCacheOutdated(file: TFile): boolean { export function isCacheOutdated(file: TFile): boolean {

View File

@@ -77,10 +77,10 @@ export async function initGlobalSearchIndex(): Promise<void> {
try { try {
const json = await app.vault.adapter.read(searchIndexFilePath) const json = await app.vault.adapter.read(searchIndexFilePath)
minisearchInstance = MiniSearch.loadJSON(json, options) minisearchInstance = MiniSearch.loadJSON(json, options)
console.log('MiniSearch index loaded from the file') console.log('Omnisearch - MiniSearch index loaded from the file')
await loadNotesCache() await loadNotesCache()
} catch (e) { } catch (e) {
console.trace('Could not load MiniSearch index from the file') console.trace('Omnisearch - Could not load MiniSearch index from the file')
console.error(e) console.error(e)
} }
} }