Skip to content

Instantly share code, notes, and snippets.

@kirkouimet kirkouimet/779244.html
Last active Oct 30, 2017

Embed
What would you like to do?
We need a way to wrap console.log and preserve the file and line number
<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
You can’t perform that action at this time.