mirror of
https://github.com/chinchang/web-maker.git
synced 2025-06-06 09:35:40 +02:00
utils: improve log fn
This commit is contained in:
parent
32c398564d
commit
ce26d84716
12
src/utils.js
12
src/utils.js
@ -100,7 +100,17 @@ export function onButtonClick(btn, listener) {
|
||||
|
||||
export function log() {
|
||||
if (window.DEBUG) {
|
||||
console.log(Date.now(), ...arguments);
|
||||
const err = new Error();
|
||||
console.log(
|
||||
parseInt(
|
||||
Date.now()
|
||||
.toString()
|
||||
.substr(4),
|
||||
10
|
||||
),
|
||||
...arguments,
|
||||
err.stack.split('\n')[2].replace(/\(.*\)/, '')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user