17 |
return m; |
return m; |
18 |
}, |
}, |
19 |
|
|
20 |
counter: function() { |
insert: function(class, m) { |
21 |
|
if (! _log_count) this.create(); |
22 |
|
|
23 |
|
_log_count[ class ]++; |
24 |
|
|
25 |
|
var html = '<div class="jql-' + class + '">' + m + '</div>'; |
26 |
|
$('#jql').append( html ); |
27 |
|
//$('#jql').prepend( html ); |
28 |
|
|
29 |
|
// refresh count |
30 |
$('#jql-counter').html( |
$('#jql-counter').html( |
31 |
'<span class="jql-info">'+_log_count.info+'</span> ' + |
'<span class="jql-info">'+_log_count.info+'</span> ' + |
32 |
'<span class="jql-debug">'+_log_count.debug+'</span> ' + |
'<span class="jql-debug">'+_log_count.debug+'</span> ' + |
34 |
); |
); |
35 |
}, |
}, |
36 |
|
|
|
toggle: function() { |
|
|
$('#jql').toggle(); |
|
|
$('#jql-show').toggle(); |
|
|
return false; |
|
|
}, |
|
|
|
|
37 |
/* public functions */ |
/* public functions */ |
38 |
|
|
39 |
create: function() { |
create: function() { |
56 |
this.debug('created logger'); |
this.debug('created logger'); |
57 |
}, |
}, |
58 |
|
|
59 |
|
toggle: function() { |
60 |
|
$('#jql').toggle(); |
61 |
|
$('#jql-show').toggle(); |
62 |
|
return false; |
63 |
|
}, |
64 |
|
|
65 |
info: function() { |
info: function() { |
66 |
if (arguments) { |
if (arguments) this.insert( 'info', this.join(arguments) ); |
|
if (! _log_count) this.create(); |
|
|
_log_count.info++; |
|
|
$('#jql').append( '<div class="jql-info">'+this.join(arguments)+'</div>' ); |
|
|
this.counter(); |
|
|
} |
|
67 |
}, |
}, |
68 |
debug: function() { |
debug: function() { |
69 |
if (arguments) { |
if (arguments) this.insert( 'debug', this.join(arguments) ); |
|
if (! _log_count) this.create(); |
|
|
_log_count.debug++; |
|
|
$('#jql').append( '<div class="jql-debug">'+this.join(arguments)+'</div>' ); |
|
|
this.counter(); |
|
|
} |
|
70 |
}, |
}, |
71 |
error: function() { |
error: function() { |
72 |
if (arguments) { |
if (arguments) this.insert( 'error', this.join(arguments) ); |
|
if (! _log_count) this.create(); |
|
|
_log_count.error++; |
|
|
$('#jql').append( '<div class="jql-error">'+this.join(arguments)+'</div>' ); |
|
|
this.counter(); |
|
|
} |
|
73 |
} |
} |
74 |
}; |
}; |
75 |
|
|