From c89f7c66a1d4aa6a4cfc72c59308571671bd8371 Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Tue, 18 Dec 2018 14:19:16 +0100 Subject: [PATCH] sparkles: Changes for new freesewing plugin model --- packages/plugin-debug/src/index.js | 39 ++++++++---------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/packages/plugin-debug/src/index.js b/packages/plugin-debug/src/index.js index 23a802189dd..4ac53654140 100644 --- a/packages/plugin-debug/src/index.js +++ b/packages/plugin-debug/src/index.js @@ -21,37 +21,18 @@ export default { name: name, version: version, hooks: { - debug: function(next, d = "", e = "", b = "", u = "", g = "") { - if(typeof d === 'object' && d.debug === 'custom') { - console.log( - "%c"+d.text, - d.style, - e, - b, - u, - g - ); - } else if(typeof d === 'object' && typeof d.style !== 'undefined') { - console.log( - "%c"+d.label, - debugStyle(d.style), - e, - b, - u, - g - ); + debug: function(data, more) { + if( + typeof data === "object" && + typeof data.type === "string" && + typeof data.label === "string" && + typeof data.msg === "string" && + Object.keys(data).length === 3) { + // Make it pretty + console.log("%c"+data.label, debugStyle(data.type), data.msg); } else { - console.log( - "%c💡 Debug", - "color: #dd69dd; font-weight: bold", - d, - e, - b, - u, - g - ); + console.log(data); } - next(); } } };