mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	logging improvements
This commit is contained in:
		
							parent
							
								
									9f33791922
								
							
						
					
					
						commit
						ea56bb772a
					
				@ -138,7 +138,7 @@ function processContent(images, note, content) {
 | 
			
		||||
                value: imageNote.noteId
 | 
			
		||||
            }).save();
 | 
			
		||||
 | 
			
		||||
            console.log(`Replacing ${imageId} with ${url}`);
 | 
			
		||||
            log.info(`Replacing ${imageId} with ${url} in note ${note.noteId}`);
 | 
			
		||||
 | 
			
		||||
            rewrittenContent = utils.replaceAll(rewrittenContent, imageId, url);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -20,7 +20,7 @@ function getNotesWithLabel(name, value) {
 | 
			
		||||
 | 
			
		||||
// TODO: should be in search service
 | 
			
		||||
/** @returns {Note|null} */
 | 
			
		||||
function getNoteWithLabel(name, value) {
 | 
			
		||||
function getNoteWithLabel(name, value = undefined) {
 | 
			
		||||
    // optimized version (~20 times faster) without using normal search, useful for e.g. finding date notes
 | 
			
		||||
    const attrs = becca.findAttributes('label', name);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -9,6 +9,7 @@ const TaskContext = require("./task_context");
 | 
			
		||||
const utils = require('./utils');
 | 
			
		||||
const becca = require("../becca/becca");
 | 
			
		||||
const beccaService = require("../becca/becca_service");
 | 
			
		||||
const log = require("./log");
 | 
			
		||||
 | 
			
		||||
function cloneNoteToNote(noteId, parentNoteId, prefix) {
 | 
			
		||||
    if (parentNoteId === 'share') {
 | 
			
		||||
@ -73,6 +74,8 @@ function ensureNoteIsPresentInParent(noteId, parentNoteId, prefix) {
 | 
			
		||||
        prefix: prefix,
 | 
			
		||||
        isExpanded: 0
 | 
			
		||||
    }).save();
 | 
			
		||||
 | 
			
		||||
    log.info(`Creating new branch between child '${noteId}' and parent '${parentNoteId}'`);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function ensureNoteIsAbsentFromParent(noteId, parentNoteId) {
 | 
			
		||||
 | 
			
		||||
@ -85,7 +85,7 @@ function updateImage(noteId, uploadBuffer, originalName) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function saveImage(parentNoteId, uploadBuffer, originalName, shrinkImageSwitch, trimFilename = false) {
 | 
			
		||||
    log.info(`Saving image ${originalName}`);
 | 
			
		||||
    log.info(`Saving image ${originalName} into parent ${parentNoteId}`);
 | 
			
		||||
 | 
			
		||||
    if (trimFilename && originalName.length > 40) {
 | 
			
		||||
        // https://github.com/zadam/trilium/issues/2307
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user