From d518675e0301c23088f5121a1710f3f78eb250bd Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 15 Mar 2024 16:49:24 +0000 Subject: [PATCH] Get rid of some console.logs --- .../modules/routes/handlers/post-bag-tiddlers.js | 1 - .../multiwikiserver/modules/routes/handlers/put-recipe.js | 1 - .../multiwikiserver/modules/routes/helpers/multipart-forms.js | 4 ---- .../multiwikiserver/modules/store/sql-tiddler-store.js | 1 - 4 files changed, 7 deletions(-) diff --git a/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/post-bag-tiddlers.js b/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/post-bag-tiddlers.js index 0d2e37539..7971c547c 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/post-bag-tiddlers.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/post-bag-tiddlers.js @@ -29,7 +29,6 @@ exports.handler = function(request,response,state) { // Get the parameters var bag_name = $tw.utils.decodeURIComponentSafe(state.params[0]), bag_name_2 = $tw.utils.decodeURIComponentSafe(state.params[1]); -console.log(`Got ${bag_name} and ${bag_name_2}`) // Require the bag names to match if(bag_name !== bag_name_2) { return state.sendResponse(400,{"Content-Type": "text/plain"},"Bad Request: bag names do not match"); diff --git a/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/put-recipe.js b/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/put-recipe.js index e769b3610..1b2c0d175 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/put-recipe.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/put-recipe.js @@ -25,7 +25,6 @@ exports.handler = function(request,response,state) { data = $tw.utils.parseJSONSafe(state.data); if(recipe_name === recipe_name_2 && data) { const result = $tw.mws.store.createRecipe(recipe_name,data.bag_names,data.description); - console.log(`create recipe route handler for ${recipe_name} with ${JSON.stringify(data)} got result ${JSON.stringify(result)}`) if(!result) { state.sendResponse(204,{ "Content-Type": "text/plain" diff --git a/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/multipart-forms.js b/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/multipart-forms.js index 313bda0a2..6bbb32480 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/multipart-forms.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/routes/helpers/multipart-forms.js @@ -33,7 +33,6 @@ exports.processIncomingStream = function(options) { const parts = []; // Array of {name:, headers:, value:, hash:} and/or {name:, filename:, headers:, inboxFilename:, hash:} options.state.streamMultipartData({ cbPartStart: function(headers,name,filename) { - console.log(`Received file ${name} and ${filename} with ${JSON.stringify(headers)}`) const part = { name: name, filename: filename, @@ -58,7 +57,6 @@ exports.processIncomingStream = function(options) { } length = length + chunk.length; hash.update(chunk); - console.log(`Got a chunk of length ${chunk.length}, length is now ${length}`); }, cbPartEnd: function() { if(fileStream) { @@ -72,7 +70,6 @@ exports.processIncomingStream = function(options) { if(err) { return options.callback(err); } else { - console.log(`Multipart form data processed as ${JSON.stringify(parts,null,4)}`); const partFile = parts.find(part => part.name === "file-to-upload" && !!part.filename); if(!partFile) { return state.sendResponse(400, {"Content-Type": "text/plain"},"Missing file to upload"); @@ -88,7 +85,6 @@ exports.processIncomingStream = function(options) { tiddlerFields[part.name.slice(tiddlerFieldPrefix.length)] = part.value.trim(); } } - console.log(`Creating tiddler with ${JSON.stringify(tiddlerFields)} and ${partFile.filename}`) options.store.saveBagTiddlerWithAttachment(tiddlerFields,options.bagname,{ filepath: partFile.inboxFilename, type: type, diff --git a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js index 241a281f6..c7029baa6 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/store/sql-tiddler-store.js @@ -250,7 +250,6 @@ type - content type of file as uploaded Returns {tiddler_id:} */ SqlTiddlerStore.prototype.saveBagTiddlerWithAttachment = function(incomingTiddlerFields,bagname,options) { - console.log(`saveBagTiddlerWithAttachment ${JSON.stringify(incomingTiddlerFields)}, ${bagname}, ${JSON.stringify(options)}`); const attachment_blob = this.attachmentStore.adoptAttachment(options.filepath,options.type,options.hash); if(attachment_blob) { return this.sqlTiddlerDatabase.saveBagTiddler(incomingTiddlerFields,bagname,attachment_blob);