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
This commit is contained in:
Damien Churchill 2011-11-04 00:44:17 +00:00
parent ab665384d4
commit d10752fc1a
1 changed files with 7 additions and 0 deletions

View File

@ -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')