Last active
October 30, 2017 16:11
-
-
Save kirkouimet/1e3dea6b5ead49e282c5b6949324e8f8 to your computer and use it in GitHub Desktop.
We need a way to wrap console.log and preserve the file and line number
This file contains hidden or 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
<html> | |
<head> | |
<title>We need a way to wrap console.log and preserve the file and line number</title> | |
<script> | |
function customLog() { | |
var processedArguments = arguments; | |
// Do something with the arguments besides logging them, maybe format them or store them | |
// ... | |
// Send the output to Developer Tools | |
// The expectation here is that we can call console.log in a different way such that the | |
// Developer Tools should not show this next line as the originating line in the console | |
console.log(arguments); // Just call it in the classic way since there is no special way to call it yet | |
} | |
</script> | |
</head> | |
<body> | |
<p><a target="_blank" href="https://bugs.chromium.org/p/chromium/issues/detail?id=779244#c1">We need a way to wrap console.log and preserve the file and line number.</a></p> | |
<button onclick="customLog('Should show line number 19.')">Developer Tools should show a log entry originating from line 19.</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment