From d10752fc1afe9869c38a0960d0e7ec4c74c842a8 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Fri, 4 Nov 2011 00:44:17 +0000 Subject: [PATCH] web: add a better log method Add a new method, deluge.log which outputs to the javascript console, including a date and time which will help when debugging speed issues --- deluge/ui/web/js/deluge-all/Deluge.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/deluge/ui/web/js/deluge-all/Deluge.js b/deluge/ui/web/js/deluge-all/Deluge.js index 2193ef35b..b5ee39ea4 100644 --- a/deluge/ui/web/js/deluge-all/Deluge.js +++ b/deluge/ui/web/js/deluge-all/Deluge.js @@ -153,6 +153,13 @@ Ext.apply(Deluge, { // Setup a space for plugins to insert themselves deluge.plugins = {}; +deluge.logDateFormat = 'd/m/Y H:i:s,u'; + +deluge.log = function(msg) { + var date = new Date() + console.log(Ext.Date.format(date, deluge.logDateFormat) + ' - ' + msg); +} + // Hinting for gettext_gen.py // _('Do Not Download') // _('Normal Priority')