-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdebug.js
More file actions
25 lines (24 loc) · 775 Bytes
/
debug.js
File metadata and controls
25 lines (24 loc) · 775 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
function debug(message, permission = 'debugging', ...extras) {
if (!settings.value(permission) && !settings.value('debugging.*')) return;
// message.stack = new Error().stack.split('\n').slice(2);
console.log(`[${permission}]`, message, ...extras);
}
fn.debug = (arg, permission = 'debugging') => {
if (!settings.value(permission) && !settings.value('debugging.*')) return false;
if (typeof arg === 'string') {
arg = {
text: arg,
};
}
const defaults = {
background: '#c8354e',
textShadow: '#e74c3c 1px 2px 1px',
css: { 'font-family': 'inherit' },
button: {
// Don't use buttons, mouseOver sucks
background: '#e25353',
textShadow: '#46231f 0px 0px 3px',
},
};
return fn.toast(fn.merge(defaults, arg));
};