Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathloggers.js
More file actions
Latest commit
75 lines (61 loc) · 1.7 KB
/
Copy pathloggers.js
File metadata and controls
75 lines (61 loc) · 1.7 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
'use strict';
/* eslint-disable no-console */
vardfltConfig=require('../plot_api/plot_config').dfltConfig;
varnotifier=require('./notifier');
varloggers=module.exports={};
/**
* ------------------------------------------
* debugging tools
* ------------------------------------------
*/
loggers.log=function(){
vari;
if(dfltConfig.logging>1){
varmessages=['LOG:'];
for(i=0;i<arguments.length;i++){
messages.push(arguments[i]);
}
console.trace.apply(console,messages);
}
if(dfltConfig.notifyOnLogging>1){
varlines=[];
for(i=0;i<arguments.length;i++){
lines.push(arguments[i]);
}
notifier(lines.join('<br>'),'long');
}
};
loggers.warn=function(){
vari;
if(dfltConfig.logging>0){
varmessages=['WARN:'];
for(i=0;i<arguments.length;i++){
messages.push(arguments[i]);
}
console.trace.apply(console,messages);
}
if(dfltConfig.notifyOnLogging>0){
varlines=[];
for(i=0;i<arguments.length;i++){
lines.push(arguments[i]);
}
notifier(lines.join('<br>'),'stick');
}
};
loggers.error=function(){
vari;
if(dfltConfig.logging>0){
varmessages=['ERROR:'];
for(i=0;i<arguments.length;i++){
messages.push(arguments[i]);
}
console.error.apply(console,messages);
}
if(dfltConfig.notifyOnLogging>0){
varlines=[];
for(i=0;i<arguments.length;i++){
lines.push(arguments[i]);
}
notifier(lines.join('<br>'),'stick');
}
};