From ce26d847164308a09385c9bb5c8a2d4b1dd17ec1 Mon Sep 17 00:00:00 2001 From: Kushagra Gour Date: Mon, 4 Mar 2019 19:00:28 +0530 Subject: [PATCH] utils: improve log fn --- src/utils.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index e7b9136..4ae5344 100644 --- a/src/utils.js +++ b/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(/\(.*\)/, '') + ); } }