Logging is a key thing to have for simpler debugging of code. Normally console.log would be used for this, when developing with JS.
It seems we cannot use console.log within code–at least I have not been able to get it to work. Even if it worked, it would be a bit messy having the whole dev tools pane open on top of all the existing frames in the editor.
So some sort of logging out functionality and view would be useful I think–just the stuff logged by the user’s code. Even in the little REPL in the corner maybe? Or a tab within that? Whatever is fine.
Just something to help people debug with this simple method. For now, I’ve made my own which just logs to the page itself.
log(msg) => document.body.appendChild(document.createElement("div")).innerText = msg;
You can use the Tester Panel on the bottom of the Editor Panel (the one with the text input), here’s some example of how to use it: Tester Panel
(Plug) You can also check some of my debugging utilities.
Right… that’s what I referred to as the REPL. It’s a programming term for “type in code, run it, and see what it returns.”
But that isn’t what logging is. Sorry if I was unclear. The whole point of logging is that the code can log stuff out as it runs. So you can have your code that adds stuff to the page, and log what it’s adding, as it goes–so that you can debug things.
Just running something and seeing what it returns doesn’t mean the code itself can send stuff to that pane. You could use that to see what is returned but not what the code decided to log out. That’s one of the possibilities I suggested.
Sorry if I misunderstood the question but now I get what you mean. I usually just use the console.log for debugging, but probably a possible use for the Tester panel is for logs appear on that little window instead of opening up the DevTools. @perchance maybeeee
Thing is, I was trying
console.log
and it wasn’t even showing up in the dev tools, somehow. Just tried it again and it’s working. No idea what was going on there.But yeah, having it be built-in in some way would be helpful. Especially for those that aren’t so web-savvy.