1
0
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:
Kushagra Gour 2019-03-04 19:00:28 +05:30
parent 32c398564d
commit ce26d84716

View File

@ -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(/\(.*\)/, '')
);
}
}