Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QBJS Console
#1
One feature that was added in the last release (that I haven't done a very good job of publicizing yet) that can help with troubleshooting is the Console library.  This lets you write logging messages to the QBJS console window based on a log level.  You can click the message in the log and it will take you to the corresponding line of code.  

If you just want to print text to the console window and you don't really care about line numbers, you can use the Console.Echo method.

Reply
#2
this is handy if you want your QBJS mods to produce directly copy-pastable output
Reply
#3
Thumbs Up 
(09-20-2023, 11:22 PM)vince Wrote: this is handy if you want your QBJS mods to produce directly copy-pastable output

Oh, good point!
b = b + ...
Reply
#4
(09-20-2023, 05:44 PM)dbox Wrote: One feature that was added in the last release (that I haven't done a very good job of publicizing yet) that can help with troubleshooting is the Console library.  This lets you write logging messages to the QBJS console window based on a log level.  You can click the message in the log and it will take you to the corresponding line of code.  

If you just want to print text to the console window and you don't really care about line numbers, you can use the Console.Echo method.

Awesome. I abuse the crap out of `console` in web development. This is a great addition!

Quote:And thus concludes the ...
LOL!

Are you open to suggestions on extending in the future? Like adding a `console.dir` to dump our QB vars and objects and things?
grymmjack (gj!)
GitHubYouTube | Soundcloud | 16colo.rs
Reply
#5
(09-21-2023, 12:40 PM)grymmjack Wrote: Awesome. I abuse the crap out of `console` in web development. This is a great addition!
Interesting you mention that... The way it is implemented, if you export your program to a standalone html/js, all the calls to console will be written to the actual browser console.  That way you can still do some basic debugging in the exported version.

(09-21-2023, 12:40 PM)grymmjack Wrote: Are you open to suggestions on extending in the future? Like adding a `console.dir` to dump our QB vars and objects and things?
Always open to suggestions!  That's a very interesting idea.  Let's add it to the list.  I'm also realizing now that it would be nice to have a Console.Show and Console.Hide so that you have programmatic access to display the console window.
Reply




Users browsing this thread: 1 Guest(s)