An implementation of the JS console object in Luau
console.time(), and more. I created this package because there were really no good ways of outputting info and debugging, so I complied a bunch of functions into a package.
Console is not faster or anything, but a bit slower. Even though it’s slower, it’s only about 0.001 seconds slower than globals which should not display any visible performance difference.
I also didn’t like how Lua did their logging statements and the lack of features it offers. I’m also just familiar with JS and wanted to share this with all of you.
Why you should use it
The main reason why is organization. Lots of print, warn, and error statements can start to get messy. Another reason why is the ease of debug. You can easily time a piece of code, soft-error the thread, and way more. And the last, my favorite one: You can easily search for the word ‘console’. Forget where you put your logging statements? Use find and replace.
Your code will look a lot cleaner and be more readable if you prefix logging statements with console.
If you have learned JS and are familiar with it, you will feel right at home.
Testing becomes a whole lot easier with single-line benchmarking.
Extra (and useful) features
I added a plethora of extra features, including easier to find stack trace, easy, quick and accurate benchmarking in microseconds, soft errors, and faster and better assert functions (we have a silent assert too!).
For now, the documentation is inside the main module of the Console package.
Thank you for taking the time out of your day to read this topic. Please put any suggestions below and I can assure you that they will be taken into consideration.
There doesn’t seem to be a link to any model or rbxm file. Did you forgot to link/attach it?
Oh sorry, It seems for me that links are not working currently. I can ping you once the bug is fixed.
what is the advantage of this over using the default console? are there any extra commands?
There’s a lot extra features mentioned in the post. Did you even read it?
There’s still no link to this.
I think a lot of the issue comes from the fact that without the source code + documentation, all anyone can really see is the image example. Even then, without seeing the code, it’s pretty tough to see how this will actually positively slot into a development experience (with the specifics of implementation, syntax, API, etc. being very important here - especially on the subject of potentially migrating existing projects)
Just saying that there are a lot of features and giving 3 examples isn’t telling us how this is an advantage over the default console.
Not to mention that no one can download the model either.
Although this is neat and all, I just feel like its a overengineered version of just the regular print, and attempting to add features that were never necessary.
I would argue that as well, though as said it offers other features and helps keep things organized. I mostly made this for people who enjoy the JS console, including myself.
Thanks for the feedback though!
I have updated the module! It now supports functions such as a count, table, and group.
The time function is now in ms instead of frames .
Soft errors now show up red in the console without stopping the main thread.