This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["log", "warn", "error"].forEach((methodName) => { | |
const originalMethod = console[methodName] | |
console[methodName] = (...args) => { | |
let initiator = "unknown place" | |
try { | |
throw new Error() | |
} catch (e) { | |
if (typeof e.stack === "string") { | |
let isFirst = true | |
for (const line of e.stack.split("\n")) { |