lib.debug.js
652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* Debug functionality
*/
lib.debug=new function(){
if(window.console!=undefined){
this.enabled=true
this.console=window.console;
}
/**
* Create console info message
*/
this.info=function(msg){
if(this.enabled){
this.console.info(msg);
}
};
/**
* Create console inspection object
*/
this.inspect=function(obj){
if(this.enabled){
this.console.dir(obj);
}
};
/**
* Create console inspection object
*/
this.trace=function(){
if(this.enabled){
this.console.trace();
}
};
/**
* Create console warning
*/
this.warn=function(msg){
if(this.enabled){
this.console.warn(msg);
}
}
}