-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.js
35 lines (31 loc) · 949 Bytes
/
debug.js
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
/**
* pretty print to console
*/
function debug(text, type) {
var pill_theme = "";
var text_theme = "background:none;color:#333;font-size:10pt";
/* default parameters */
if (type === undefined) {
type = "msg";
}
if (type == "msg") {
pill_theme = "background:#478;color:#fff;border:1pt solid #fff;" +
"padding:0pt 6pt;border-radius:16pt;font-size:10pt";
}
else if (type == "success") {
pill_theme = "background:#495;color:#fff;border:1pt solid #fff;" +
"padding:0pt 6pt;border-radius:16pt;font-size:10pt";
}
else if (type == "warning") {
pill_theme = "background:#995588;color:#fff;" +
"border:1pt solid #fff;padding:0pt 6pt;" +
"border-radius:16pt;font-size:10pt";
}
else if (type == "error") {
pill_theme = "background:#ff0033;color:#fff;" +
"border:1pt solid #fff;padding:0pt 6pt;" +
"border-radius:16pt;font-size:10pt";
}
else { }
console.log("%c%s%c", pill_theme, type, text_theme,text);
}