Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
removed forgotten console.logs
zadam5a8c3f6a2ba9
diff --git a/src/public/app/widgets/attribute_editor.js b/src/public/app/widgets/attribute_editor.jsindex d1113c708a..2db6cb480d 100644--- a/src/public/app/widgets/attribute_editor.js+++ b/src/public/app/widgets/attribute_editor.js@@ -394,7 +394,7 @@ export default class AttributeEditorWidget extends TabAwareWidget {}}- showHelpTooltip() {console.log("showHelpTooltip");+ showHelpTooltip() {this.attributeDetailWidget.hide();this.$editor.tooltip({@@ -454,7 +454,7 @@ export default class AttributeEditorWidget extends TabAwareWidget {attributeRenderer.renderAttribute(attribute, $attributesContainer, true);}}-+this.textEditor.setData($attributesContainer.html());if (saved) {diff --git a/src/public/app/widgets/note_tree.js b/src/public/app/widgets/note_tree.jsindex 45f9919da2..5e4c3e3fdd 100644--- a/src/public/app/widgets/note_tree.js+++ b/src/public/app/widgets/note_tree.js@@ -977,14 +977,12 @@ export default class NoteTreeWidget extends TabAwareWidget {toastService.showMessage("Auto collapsing notes after inactivity...");noneCollapsedYet = false;}-- console.log("Auto collapsed", node.data.noteId);}}, false);}, 600 * 1000);}- async entitiesReloadedEvent({loadResults}) {console.log(loadResults);+ async entitiesReloadedEvent({loadResults}) {this.activityDetected();if (loadResults.isEmptyForTree()) {diff --git a/src/public/app/widgets/type_widgets/image.js b/src/public/app/widgets/type_widgets/image.jsindex 2009fb088f..5e5ffc5673 100644--- a/src/public/app/widgets/type_widgets/image.js+++ b/src/public/app/widgets/type_widgets/image.js@@ -127,7 +127,7 @@ class ImageTypeWidget extends TypeWidget {this.$widget.show();- const noteComplement = await this.tabContext.getNoteComplement();console.log(noteComplement, note);+ const noteComplement = await this.tabContext.getNoteComplement();this.$fileName.text(attributeMap.originalFileName || "?");this.$fileSize.text(noteComplement.contentLength + " bytes");diff --git a/src/routes/api/recent_changes.js b/src/routes/api/recent_changes.jsindex a9254be6dc..1a8e1a331a 100644--- a/src/routes/api/recent_changes.js+++ b/src/routes/api/recent_changes.js@@ -55,8 +55,6 @@ function getRecentChanges(req) {recentChanges = recentChanges.slice(0, Math.min(500, recentChanges.length));- console.log(recentChanges);-for (const change of recentChanges) {if (change.current_isProtected) {if (protectedSessionService.isProtectedSessionAvailable()) {diff --git a/src/services/search/services/search.js b/src/services/search/services/search.jsindex 495e0b3217..1b2b27e71e 100644--- a/src/services/search/services/search.js+++ b/src/services/search/services/search.js@@ -30,7 +30,7 @@ function findNotesWithExpression(expression) {const noteSet = expression.execute(allNoteSet, searchContext);- let searchResults = noteSet.notes+ const searchResults = noteSet.notes.map(note => searchContext.noteIdToNotePath[note.noteId] || noteCacheService.getSomePath(note)).filter(notePathArray => notePathArray.includes(hoistedNoteService.getHoistedNoteId())).map(notePathArray => new SearchResult(notePathArray));@@ -70,13 +70,15 @@ function parseQueryToExpression(query, parsingContext) {* @return {SearchResult[]}*/function findNotesWithQuery(query, parsingContext) {- const expression = parseQueryToExpression(query, parsingContext);+ return utils.stopWatch(`Search with query "${query}"`, () => {+ const expression = parseQueryToExpression(query, parsingContext);- if (!expression) {- return [];- }+ if (!expression) {+ return [];+ }- return findNotesWithExpression(expression);+ return findNotesWithExpression(expression);+ });}/**diff --git a/src/services/utils.js b/src/services/utils.jsindex aecb939996..843b45c48d 100644--- a/src/services/utils.js+++ b/src/services/utils.js@@ -7,6 +7,7 @@ const escape = require('escape-html');const sanitize = require("sanitize-filename");const mimeTypes = require('mime-types');const path = require('path');+const log = require('./log');function newEntityId() {return randomString(12);@@ -65,13 +66,13 @@ function prepareSqlForLike(prefix, str, suffix) {}function stopWatch(what, func) {- const start = new Date();+ const start = Date.now();const ret = func();- const tookMs = Date.now() - start.getTime();+ const tookMs = Date.now() - start;- console.log(`${what} took ${tookMs}ms`);+ log.info(`${what} took ${tookMs}ms`);return ret;}